Re: [PATCH v2 4/4] iio: Add OF support

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

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux