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

2019-05-30 Thread Jason Gunthorpe
On Wed, May 29, 2019 at 10:15:28AM -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/hfi1: Use struct_size() helper

2019-05-30 Thread Dennis Dalessandro
On 5/29/2019 11:15 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(struct opa_port_status_rsp

[PATCH][next] IB/hfi1: 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(struct opa_port_status_rsp) + num_vls * sizeof(struct _vls_pctrs) with: stru