Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-09 Thread Dan Carpenter
On Mon, Jun 09, 2014 at 09:24:35PM -0400, Marcos A. Di Pietro wrote: > Fixes warning static analysis warning raised by sparse in > drivers/staging/comedi/drivers/ni_stc.h > > warning: shift too big (4294967295) for type int This warning seems wrong. I don't even understand how it thinks the shi

RE: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-10 Thread Hartley Sweeten
On Monday, June 09, 2014 10:48 PM, Dan Carpenter wrote: > On Mon, Jun 09, 2014 at 09:24:35PM -0400, Marcos A. Di Pietro wrote: >> Fixes warning static analysis warning raised by sparse in >> drivers/staging/comedi/drivers/ni_stc.h >> >> warning: shift too big (4294967295) for type int > > This wa

Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-10 Thread Dan Carpenter
On Tue, Jun 10, 2014 at 10:36:13PM +, Hartley Sweeten wrote: > On Monday, June 09, 2014 10:48 PM, Dan Carpenter wrote: > > On Mon, Jun 09, 2014 at 09:24:35PM -0400, Marcos A. Di Pietro wrote: > >> Fixes warning static analysis warning raised by sparse in > >> drivers/staging/comedi/drivers/ni_

RE: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-11 Thread Hartley Sweeten
On Tuesday, June 10, 2014 11:56 PM, Dan Carpenter wrote: > On Tue, Jun 10, 2014 at 10:36:13PM +, Hartley Sweeten wrote: >> On Monday, June 09, 2014 10:48 PM, Dan Carpenter wrote: >>> On Mon, Jun 09, 2014 at 09:24:35PM -0400, Marcos A. Di Pietro wrote: Fixes warning static analysis warning

Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-11 Thread Dan Carpenter
Let's forward this to the Sparse mailing list. We're seeing a Sparse false positive testing drivers/staging/comedi/drivers/ni_pcimio.c. CHECK drivers/staging/comedi/drivers/ni_pcimio.c drivers/staging/comedi/drivers/ni_stc.h:720:26: warning: shift too big (4294967295) for type int drivers/st

Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-11 Thread josh
On Thu, Jun 12, 2014 at 12:24:25AM +0300, Dan Carpenter wrote: > Let's forward this to the Sparse mailing list. > > We're seeing a Sparse false positive testing > drivers/staging/comedi/drivers/ni_pcimio.c. > > CHECK drivers/staging/comedi/drivers/ni_pcimio.c > drivers/staging/comedi/drivers/

Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-15 Thread Sam Ravnborg
Hi Josh. On Wed, Jun 11, 2014 at 02:45:29PM -0700, j...@joshtriplett.org wrote: > On Thu, Jun 12, 2014 at 12:24:25AM +0300, Dan Carpenter wrote: > > Let's forward this to the Sparse mailing list. > > > > We're seeing a Sparse false positive testing > > drivers/staging/comedi/drivers/ni_pcimio.c.

Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-16 Thread Dan Carpenter
On Sun, Jun 15, 2014 at 09:32:27PM +0200, Sam Ravnborg wrote: > diff --git a/expand.c b/expand.c > index 0f6720c..4a96de4 100644 > --- a/expand.c > +++ b/expand.c > @@ -187,7 +187,7 @@ static int simplify_int_binop(struct expression *expr, > struct symbol *ctype) > return 0; >

Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-16 Thread Sam Ravnborg
On Mon, Jun 16, 2014 at 10:40:19AM +0300, Dan Carpenter wrote: > On Sun, Jun 15, 2014 at 09:32:27PM +0200, Sam Ravnborg wrote: > > diff --git a/expand.c b/expand.c > > index 0f6720c..4a96de4 100644 > > --- a/expand.c > > +++ b/expand.c > > @@ -187,7 +187,7 @@ static int simplify_int_binop(struct ex

Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-28 Thread Christopher Li
Sorry for the late reply. On Wed, Jun 11, 2014 at 2:45 PM, wrote: > On Thu, Jun 12, 2014 at 12:24:25AM +0300, Dan Carpenter wrote: >> Let's forward this to the Sparse mailing list. >> >> We're seeing a Sparse false positive testing No, this is a valid complain. See my point follows. >> drivers

Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-28 Thread Josh Triplett
On Sat, Jun 28, 2014 at 11:07:48AM -0700, Christopher Li wrote: > On Wed, Jun 11, 2014 at 2:45 PM, wrote: > > On Thu, Jun 12, 2014 at 12:24:25AM +0300, Dan Carpenter wrote: > >> Let's forward this to the Sparse mailing list. > >> > >> We're seeing a Sparse false positive testing > > No, this is

Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-28 Thread Christopher Li
On Sat, Jun 28, 2014 at 12:20 PM, Josh Triplett wrote: > Except that "filter" has an "int channel" (signed), so it can > successfully test "channel < 0" and return early; it'll never call > ni_stc_dma_channel_select_bitfield(channel) with a negative number. > > I do agree that this code should sor

Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-30 Thread Christopher Li
On Sat, Jun 28, 2014 at 8:09 PM, Christopher Li wrote: > So if there is a bug, It is sparse did not know exactly which part > of the code is dead on AST level. If you enable the "#if 0" inside I am thinking about how to fix the dead code issue. Try to do more than trivial dead code analyses is re

Re: [PATCH] Staging/comedi: Fixes static analysis warning raised by sparse

2014-06-30 Thread Christopher Li
On Mon, Jun 30, 2014 at 10:49 AM, Christopher Li wrote: > The warning should be trivial in instruction level. We are looking > for an instruction has larger than type size constant shift > value. Actually, just try it. Not as trivial as I thought. The problem is that, in the instruction level, s