Re: [PATCH][next] IB/qib: Use struct_size() helper

2019-05-30 Thread Jason Gunthorpe
On Wed, May 29, 2019 at 10:13:26AM -0500, Gustavo A. R. Silva wrote: > Make use of the struct_size() helper instead of an open-coded version > in order to avoid any potential type mistakes, in particular in the > context in which this code is being used. > > So, replace the following form: > > si

Re: [PATCH][next] IB/qib: Use struct_size() helper

2019-05-30 Thread Dennis Dalessandro
On 5/29/2019 11:13 AM, Gustavo A. R. Silva wrote: Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes, in particular in the context in which this code is being used. So, replace the following form: sizeof(*pkt) + sizeof(pkt->addr[0

[PATCH][next] IB/qib: Use struct_size() helper

2019-05-29 Thread Gustavo A. R. Silva
Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes, in particular in the context in which this code is being used. So, replace the following form: sizeof(*pkt) + sizeof(pkt->addr[0])*n with: struct_size(pkt, addr, n) Also, notice