Re: [PATCH net-next] cxgb4: cxgb4_tc_u32: use struct_size() in kvzalloc()

2019-01-29 Thread Gustavo A. R. Silva
On 1/29/19 12:57 PM, David Miller wrote: >> >> Signed-off-by: Gustavo A. R. Silva > > Applied, thanks. > Thanks, Dave. -- Gustavo

Re: [PATCH net-next] cxgb4: cxgb4_tc_u32: use struct_size() in kvzalloc()

2019-01-29 Thread David Miller
From: "Gustavo A. R. Silva" Date: Tue, 29 Jan 2019 11:05:23 -0600 > 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 fo

[PATCH net-next] cxgb4: cxgb4_tc_u32: use struct_size() in kvzalloc()

2019-01-29 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 = kvzalloc(sizeof(stru