Re: [PATCH] mm: slab: Avoid the use of one-element array and use struct_size() helper

2020-07-29 Thread Gustavo A. R. Silva
Hi, If you are going to copy/paste this, please at least CC the people that is originally working on these changes, in this case _me_. One needs to be very careful when doing these transformations. This code doesn't even exist in linux-next. If you want to land your first kernel patch, I

Re: [PATCH] mm: slab: Avoid the use of one-element array and use struct_size() helper

2020-07-29 Thread David Rientjes
On Wed, 29 Jul 2020, Qianli Zhao wrote: > From: Qianli Zhao > > There is a regular need in the kernel to provide a way to declare having a > dynamically sized set of trailing elements in a structure. Kernel code should > always use “flexible array members”[1] for these cases. The older style of

[PATCH] mm: slab: Avoid the use of one-element array and use struct_size() helper

2020-07-29 Thread Qianli Zhao
From: Qianli Zhao There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer