On Sun, Apr 21, 2019 at 06:15:21PM +, Peter Rosin wrote:
> On 2019-01-04 19:06, Wolfram Sang wrote:
> >
> >> Instead of leaving these open-coded and prone to type mistakes, we can
> >> now use the new struct_size() helper:
> >
> > I am okay with this patch in general. However, I think the
On 2019-01-04 19:06, Wolfram Sang wrote:
>
>> Instead of leaving these open-coded and prone to type mistakes, we can
>> now use the new struct_size() helper:
>
> I am okay with this patch in general. However, I think the name of the
> helper 'struct_size' is a bit unfortunate. I really wondered
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:
struct foo {
int stuff;
void *entry[];
};
instance = devm_kzalloc(dev,
> Instead of leaving these open-coded and prone to type mistakes, we can
> now use the new struct_size() helper:
I am okay with this patch in general. However, I think the name of the
helper 'struct_size' is a bit unfortunate. I really wondered on the
first read why it needs 3 arguments to find
4 matches
Mail list logo