Re: [PATCH net-next] can: kvaser_usb: Use struct_size() in alloc_candev()

2019-02-25 Thread Marc Kleine-Budde
On 2/8/19 4:10 AM, 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 { > int stuff;

Re: [PATCH net-next] can: kvaser_usb: Use struct_size() in alloc_candev()

2019-02-25 Thread Gustavo A. R. Silva
Hi all, Friendly ping: Who can take this? Thanks -- Gustavo On 2/7/19 9:10 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

[PATCH net-next] can: kvaser_usb: Use struct_size() in alloc_candev()

2019-02-07 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 = alloc(sizeof(struct foo)