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

Started by Dan Carpenter on Aug 18, 2011

open the first message on its own page

Message details and related content
On Thu, Aug 18, 2011 at 07:50:45PM +0530, Zic Rim wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help