[PATCH v2 4/4] iio: Add OF support
Guenter Roeck
linux at roeck-us.net
Tue Feb 5 03:37:04 EST 2013
On Sun, Feb 03, 2013 at 08:22:13AM -0800, Guenter Roeck wrote:
[ ... ]
> > > +
> > > + /* NULL terminated array to save passing size */
> > > + chans = kzalloc(sizeof(*chans)*(nummaps + 1), GFP_KERNEL);
> >
> > I think using kcalloc makes sense here.
> >
> that would leave chan->data uninitialized, and I would have to initialize it
> explicitly. also, if additional fields are ever added, we would risk having
> uninitialized fields. Using kzalloc avoids a potential future error case, so I
> would prefer to keep it.
>
Please ignore this one.
Looks like my brain was too flu-foggy to realize that kcalloc does clear the
memory.
Guenter
More information about the devicetree-discuss
mailing list