Re: [patch 1/2 -next] hid-lg4ff: silence sparse complaint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 18, 2011 at 07:50:45PM +0530, Zic Rim wrote:
> > device_attribute *attr, char *buf)
> >  {
> > -       struct lg4ff_device_entry *entry = 0;
> > +       struct lg4ff_device_entry *uninitialized_var(entry);
> >
> 
> I think this is better      struct lg4ff_device_entry *entry = NULL ;
> 

We only have the initialization to silence a gcc warning.  My way is
more explicit.  If we set entry = NULL then other static analysis
tools complain about a potential NULL dereference.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux