Re: [PATCH][next] Bluetooth: mgmt: Use struct_size() helper

2019-02-26 Thread Marcel Holtmann
Hi Gustavo, > 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, change the following form: > > sizeof(*rp) + (sizeof(rp->entry[0]) * count); > > to : >

[PATCH][next] Bluetooth: mgmt: Use struct_size() helper

2019-02-25 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, change the following form: sizeof(*rp) + (sizeof(rp->entry[0]) * count); to : struct_size(rp, entry, count) No