Re: [PATCH][next] bcache: Use struct_size() in kzalloc()

2020-06-19 Thread Coly Li
On 2020/6/18 13:42, Joe Perches wrote: > On Thu, 2020-06-18 at 13:38 +0800, Coly Li wrote: >> On 2020/6/18 06:27, 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. > [] >>> diff --git a/drivers/md/

Re: [PATCH][next] bcache: Use struct_size() in kzalloc()

2020-06-17 Thread Joe Perches
On Thu, 2020-06-18 at 13:38 +0800, Coly Li wrote: > On 2020/6/18 06:27, 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. [] > > diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/write

Re: [PATCH][next] bcache: Use struct_size() in kzalloc()

2020-06-17 Thread Coly Li
On 2020/6/18 06:27, 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. > > This code was detected with the help of Coccinelle and, audited and > fixed manually. > > Signed-off-by: Gustavo A. R. Silva

[PATCH][next] bcache: Use struct_size() in kzalloc()

2020-06-17 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. This code was detected with the help of Coccinelle and, audited and fixed manually. Signed-off-by: Gustavo A. R. Silva --- drivers/md/bcache/writeback.c | 6 ++ 1 file change