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

2019-05-30 Thread Jason Gunthorpe
On Wed, May 29, 2019 at 10:12:48AM -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: > >

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

2019-05-30 Thread Jason Gunthorpe
On Thu, May 30, 2019 at 02:26:22PM -0400, Dennis Dalessandro wrote: > On 5/29/2019 11:12 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

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

2019-05-30 Thread Dennis Dalessandro
On 5/29/2019 11:12 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 rvt_sge) *

[PATCH][next] IB/rdmavt: 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 rvt_sge) * init_attr->cap.max_send_sge + sizeof(struct rvt_swqe)