Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-24 Thread S, Venkatraman
On Wed, Aug 24, 2011 at 2:08 AM, Sam Ravnborg wrote: >> >> I'm still a little confused -- the {0} or memset(0, struct ..); >> formations are used often in the kernel, even with pointers involved. >> Is the warning (Wnon_pointer_null) run against the kernel by default, >> or did Venkatraman add it

Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-24 Thread S, Venkatraman
On Wed, Aug 24, 2011 at 4:10 AM, J Freyensee wrote: > On 08/23/2011 09:56 AM, Sam Ravnborg wrote: >> >> On Tue, Aug 23, 2011 at 12:31:55PM -0400, Chris Ball wrote: >>> >>> Hi, >>> >>> [Adding linux-sparse@ to CC] >>> >>> On Tue, Aug 23 2011, Venkatraman S wrote: Fix the sparse warning ou

Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-23 Thread J Freyensee
On 08/23/2011 09:56 AM, Sam Ravnborg wrote: On Tue, Aug 23, 2011 at 12:31:55PM -0400, Chris Ball wrote: Hi, [Adding linux-sparse@ to CC] On Tue, Aug 23 2011, Venkatraman S wrote: Fix the sparse warning output "warning: Using plain integer as NULL pointer" Signed-off-by: Venkatraman S --- d

Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-23 Thread Ben Pfaff
Josh Triplett writes: > On Tue, Aug 23, 2011 at 11:04:08AM -0700, Ben Pfaff wrote: >> Josh Triplett writes: >> >> > On Tue, Aug 23, 2011 at 12:31:55PM -0400, Chris Ball wrote: >> >> On Tue, Aug 23 2011, Venkatraman S wrote: >> >> > - struct mmc_request mrq = {0}; >> >> > + struct mm

Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-23 Thread Sam Ravnborg
> > I'm still a little confused -- the {0} or memset(0, struct ..); > formations are used often in the kernel, even with pointers involved. > Is the warning (Wnon_pointer_null) run against the kernel by default, > or did Venkatraman add it manually? If default, is it catching bugs? Did a quick "

Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-23 Thread Sam Ravnborg
On Tue, Aug 23, 2011 at 02:28:42PM -0400, Chris Ball wrote: > Hi, > > On Tue, Aug 23 2011, Josh Triplett wrote: > > {} produces the same effect, as far as I know. > > Yeah. I prefer {0}, because {} is a gcc-ism (the ANSI grammar demands > initializer-lists be non-empty) and is less readable for

Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-23 Thread Ben Pfaff
Josh Triplett writes: > On Tue, Aug 23, 2011 at 12:31:55PM -0400, Chris Ball wrote: >> On Tue, Aug 23 2011, Venkatraman S wrote: >> > - struct mmc_request mrq = {0}; >> > + struct mmc_request mrq = {NULL}; >> >> The sparse warning is mistaken. Or I'm mistaken. But I suspect it's >> the spars

Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-23 Thread Chris Ball
Hi, On Tue, Aug 23 2011, Josh Triplett wrote: > {} produces the same effect, as far as I know. Yeah. I prefer {0}, because {} is a gcc-ism (the ANSI grammar demands initializer-lists be non-empty) and is less readable for people who haven't seen the idiom before and are wondering what's going on

Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-23 Thread Josh Triplett
On Tue, Aug 23, 2011 at 11:04:08AM -0700, Ben Pfaff wrote: > Josh Triplett writes: > > > On Tue, Aug 23, 2011 at 12:31:55PM -0400, Chris Ball wrote: > >> On Tue, Aug 23 2011, Venkatraman S wrote: > >> > -struct mmc_request mrq = {0}; > >> > +struct mmc_request mrq = {NULL}; > >>

Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-23 Thread Chris Ball
Hi, On Tue, Aug 23 2011, Sam Ravnborg wrote: >> So we're not assigning 0 to a pointer, or whatever sparse thinks we're >> doing -- we're initializing every member of the struct with 0, which is >> a good and safe way to initialize it. >> >> Sparse folks, any comment? > > The struct looks like thi

Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-23 Thread Josh Triplett
On Tue, Aug 23, 2011 at 12:31:55PM -0400, Chris Ball wrote: > Hi, > > [Adding linux-sparse@ to CC] > > On Tue, Aug 23 2011, Venkatraman S wrote: > > Fix the sparse warning output > > "warning: Using plain integer as NULL pointer" > > > > Signed-off-by: Venkatraman S > > --- > > drivers/mmc/card

Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-23 Thread Sam Ravnborg
On Tue, Aug 23, 2011 at 12:31:55PM -0400, Chris Ball wrote: > Hi, > > [Adding linux-sparse@ to CC] > > On Tue, Aug 23 2011, Venkatraman S wrote: > > Fix the sparse warning output > > "warning: Using plain integer as NULL pointer" > > > > Signed-off-by: Venkatraman S > > --- > > drivers/mmc/card

Re: [PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-23 Thread Chris Ball
Hi, [Adding linux-sparse@ to CC] On Tue, Aug 23 2011, Venkatraman S wrote: > Fix the sparse warning output > "warning: Using plain integer as NULL pointer" > > Signed-off-by: Venkatraman S > --- > drivers/mmc/card/block.c|4 ++-- > drivers/mmc/core/core.c |2 +- > drivers/mmc/co

[PATCH 2/2] mmc: fix integer assignments to pointer

2011-08-23 Thread Venkatraman S
Fix the sparse warning output "warning: Using plain integer as NULL pointer" Signed-off-by: Venkatraman S --- drivers/mmc/card/block.c|4 ++-- drivers/mmc/core/core.c |2 +- drivers/mmc/core/mmc_ops.c |4 ++-- drivers/mmc/core/sdio_ops.c |2 +- 4 files changed, 6 inserti