Re: staging/dgap/dgap.c:981: bad if test ?

2015-01-22 Thread DaeSeok Youn
Hi, 2015-01-22 19:14 GMT+09:00 Dan Carpenter : > > On Thu, Jan 22, 2015 at 10:05:53AM +, David Binderman wrote: >> Hello there, >> >> [linux-3.19-rc5/drivers/staging/dgap/dgap.c:981]: (warning) Logical >> disjunction always evaluates to true: conc_type != 65 || conc_type != 66. >> >> Source c

RE: staging/dgap/dgap.c:981: bad if test ?

2015-01-22 Thread David Binderman
Hello there, > On Thu, Jan 22, 2015 at 10:20:44AM +, David Binderman wrote: >> I used the static analyser cppcheck to find these two bugs, but >> you might be able to find similar problems by using gcc compiler >> flag -Wlogical-op. > > I turned it on,

Re: staging/dgap/dgap.c:981: bad if test ?

2015-01-22 Thread Dan Carpenter
On Thu, Jan 22, 2015 at 10:20:44AM +, David Binderman wrote: > I used the static analyser cppcheck to find these two bugs, but > you might be able to find similar problems by using gcc compiler > flag -Wlogical-op. I turned it on, but GCC 4.7.2 doesn't find anything for me. It complains about

RE: staging/dgap/dgap.c:981: bad if test ?

2015-01-22 Thread David Binderman
:22 +0300 > From: dan.carpen...@oracle.com > To: dcb...@hotmail.com; daeseok.y...@gmail.com > CC: driverdev-devel@linuxdriverproject.org > Subject: Re: staging/dgap/dgap.c:981: bad if test ? > > > On Thu, Jan 22, 2015 at 10:05:53AM +, David Binderman wrote: >> Hell

Re: staging/dgap/dgap.c:981: bad if test ?

2015-01-22 Thread Dan Carpenter
On Thu, Jan 22, 2015 at 10:05:53AM +, David Binderman wrote: > Hello there, > > [linux-3.19-rc5/drivers/staging/dgap/dgap.c:981]: (warning) Logical > disjunction always evaluates to true: conc_type != 65 || conc_type != 66. > > Source code is > >     if (conc_type == 0 || conc_type

staging/dgap/dgap.c:981: bad if test ?

2015-01-22 Thread David Binderman
Hello there, [linux-3.19-rc5/drivers/staging/dgap/dgap.c:981]: (warning) Logical disjunction always evaluates to true: conc_type != 65 || conc_type != 66. Source code is     if (conc_type == 0 || conc_type != CX ||     conc_type != EPC) { Suggest code rework. Regards Davi