Skip to contentSkip to conversation

staging: dgap: fix "if" statement that always evaluates to true

PATCH New Daeseok Youn 1 participant 1 message Jan 23, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: dgap: fix "if" statement that always evaluates to true

cppcheck warning:
(warnning) Logical disjunction always evaluates to true

---
 drivers/staging/dgap/dgap.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/dgap/dgap.c +4 -4
index 518ab56..7184747 100644
@@ -978,8 +978,8 @@ static int dgap_parsefile(char **in)
 				brd->u.board.conc1++;
 
 			conc_type = dgap_gettok(in);
-			if (conc_type == 0 || conc_type != CX ||
-			    conc_type != EPC) {
+			if (conc_type == 0 || (conc_type != CX &&
+			    conc_type != EPC)) {
 				pr_err("failed to set a type of concentratros");
 				return -1;
 			}
@@ -1019,8 +1019,8 @@ static int dgap_parsefile(char **in)
 				brd->u.board.module1++;
 
 			module_type = dgap_gettok(in);
-			if (module_type == 0 || module_type != PORTS ||
-			    module_type != MODEM) {
+			if (module_type == 0 || (module_type != PORTS &&
+			    module_type != MODEM)) {
 				pr_err("failed to set a type of module");
 				return -1;
 			}
Signature · 1 line
1.7.1