Re: [PATCH net-next] net: hns: use struct_size() in devm_kzalloc()

2019-02-27 Thread David Miller
From: "Gustavo A. R. Silva" Date: Mon, 25 Feb 2019 18:27:57 -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] net: hns: use struct_size() in devm_kzalloc()

2019-02-25 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 = devm_kzalloc(dev, si

Re: [PATCH net-next] net: hns: Use struct_size() in devm_kzalloc()

2019-01-17 Thread David Miller
From: "Gustavo A. R. Silva" Date: Tue, 15 Jan 2019 19:04:56 -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] net: hns: Use struct_size() in devm_kzalloc()

2019-01-15 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 = devm_kzalloc(dev, si