staging: dgap: fix "if" statement that always evaluates to true
authorDaeseok Youn <daeseok.youn@gmail.com>
Fri, 23 Jan 2015 11:44:28 +0000 (20:44 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Jan 2015 12:08:13 +0000 (20:08 +0800)
cppcheck warning:
(warnning) Logical disjunction always evaluates to true

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgap/dgap.c

index 518ab56..7184747 100644 (file)
@@ -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;
                        }