Re: powerpc/ps3: Use struct_size() in kzalloc()

2019-01-24 Thread Gustavo A. R. Silva
On 1/23/19 9:40 PM, Michael Ellerman wrote: > On Tue, 2019-01-08 at 21:00:10 UTC, "Gustavo A. R. Silva" wrote: >> 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

Re: powerpc/ps3: Use struct_size() in kzalloc()

2019-01-23 Thread Michael Ellerman
On Tue, 2019-01-08 at 21:00:10 UTC, "Gustavo A. R. Silva" wrote: > 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

Re: [PATCH] powerpc/ps3: Use struct_size() in kzalloc()

2019-01-16 Thread Gustavo A. R. Silva
Hi Geoff, On 1/16/19 11:21 AM, Geoff Levand wrote: Hi Gustavo, On 1/8/19 1:00 PM, Gustavo A. R. Silva wrote: 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

Re: [PATCH] powerpc/ps3: Use struct_size() in kzalloc()

2019-01-16 Thread Geoff Levand
Hi Gustavo, On 1/8/19 1:00 PM, Gustavo A. R. Silva wrote: > 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 { >

[PATCH] powerpc/ps3: Use struct_size() in kzalloc()

2019-01-08 Thread Gustavo A. R. Silva
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 = kzalloc(sizeof(struct