From: Daeseok Youn Date: Fri, 23 Jan 2015 11:44:28 +0000 (+0900) Subject: staging: dgap: fix "if" statement that always evaluates to true X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ce5b615bc29273de705188e8a827dd7663069602;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git staging: dgap: fix "if" statement that always evaluates to true cppcheck warning: (warnning) Logical disjunction always evaluates to true Reported-by: David Binderman Signed-off-by: Daeseok Youn Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 518ab567ca4e..7184747e0652 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -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; }