Re: [PATCH] libnvdimm, region: Use struct_size() in kzalloc()

2019-08-28 Thread Verma, Vishal L
On Wed, 2019-08-28 at 14:36 -0500, Gustavo A. R. Silva wrote: > struct_size() does not apply to those scenarios. See below... > > > [1]: > > https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git/tree/drivers/nvdimm/region_devs.c#n1030 > > struct_size() only applies to structures of

Re: [PATCH] libnvdimm, region: Use struct_size() in kzalloc()

2019-08-28 Thread Gustavo A. R. Silva
Hi Vishal, On 8/28/19 1:51 PM, Verma, Vishal L wrote: [..] > > Hi Gustavo, > > The patch looks good to me, however it looks like it might've missed > some instances where this replacement can be performed? > struct_size() does not apply to those scenarios. See below... > > [1]: >

Re: [PATCH] libnvdimm, region: Use struct_size() in kzalloc()

2019-08-28 Thread Verma, Vishal L
On Mon, 2019-06-10 at 16:06 -0500, 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

Re: [PATCH] libnvdimm, region: Use struct_size() in kzalloc()

2019-08-28 Thread Gustavo A. R. Silva
Hi all, Friendly ping: Who can take this, please? Thanks -- Gustavo On 6/10/19 4:06 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

[PATCH] libnvdimm, region: Use struct_size() in kzalloc()

2019-06-10 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 nd_region { ... struct nd_mapping mapping[0]; }; instance =

[PATCH] libnvdimm, region: use struct_size() in kzalloc()

2019-02-21 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; struct boo entry[]; }; instance =