Re: [PATCH] staging: comedi: serial2002: quiet NULL pointer sparsenoise

From: Dan Carpenter
Date: Fri Jun 08 2012 - 05:49:11 EST


On Fri, Jun 08, 2012 at 10:07:30AM +0100, Ian Abbott wrote:
> I wonder if it also issues that warning for a struct initializer such as
> {0} where the first member of the struct is a pointer, or would it
> expect you to use {NULL} which is more confusing when the struct
> contains a mixture of pointer and non-pointer members?
>

It does warn about that. The fix is to just say:

struct foo bar = {};

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/