Re: [PATCH] kernel: module: Use struct_size() helper

2019-06-06 Thread Gustavo A. R. Silva
Hi Jessica, On 6/6/19 1:05 PM, Jessica Yu wrote: > Hi Gustavo! > > I see you've sent similar cleanup patches elsewhere, do you think you > could reword your commit message to be more similar to your patch here > for instance: > > https://lkml.org/lkml/2019/6/5/856 > > It does a *much* bett

Re: [PATCH] kernel: module: Use struct_size() helper

2019-06-06 Thread Jessica Yu
+++ Gustavo A. R. Silva [04/06/19 18:23 -0500]: 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(*sect_attrs) + nloaded * siz

[PATCH] kernel: module: Use struct_size() helper

2019-06-04 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(*sect_attrs) + nloaded * sizeof(sect_attrs->attrs[0] with: struct_size(sect_