Re: [PATCH] drm/amdgpu/smu10: Replace one-element array and use struct_size() helper

2020-05-22 Thread Alex Deucher
On Fri, May 22, 2020 at 1:46 PM Gustavo A. R. Silva wrote: > > On Wed, May 20, 2020 at 09:42:27AM +0200, Christian König wrote: > > > > > > Signed-off-by: Gustavo A. R. Silva > > > > Acked-by: Christian König > > > > May I suggest that we add a section how to correctly do this to > >

Re: [PATCH] drm/amdgpu/smu10: Replace one-element array and use struct_size() helper

2020-05-22 Thread Gustavo A. R. Silva
On Wed, May 20, 2020 at 09:42:27AM +0200, Christian König wrote: > > > > Signed-off-by: Gustavo A. R. Silva > > Acked-by: Christian König > > May I suggest that we add a section how to correctly do this to > Documentation/process/coding-style.rst or similar document? > That's already on my

Re: [PATCH] drm/amdgpu/smu10: Replace one-element array and use struct_size() helper

2020-05-20 Thread Alex Deucher
Applied. thanks! Alex On Wed, May 20, 2020 at 3:42 AM Christian König wrote: > > Am 20.05.20 um 00:55 schrieb Gustavo A. R. Silva: > > The current codebase makes use of one-element arrays in the following > > form: > > > > struct something { > > int length; > > u8 data[1]; > > }; > >

Re: [PATCH] drm/amdgpu/smu10: Replace one-element array and use struct_size() helper

2020-05-20 Thread Christian König
Am 20.05.20 um 00:55 schrieb Gustavo A. R. Silva: The current codebase makes use of one-element arrays in the following form: struct something { int length; u8 data[1]; }; struct something *instance; instance = kmalloc(sizeof(*instance) + size, GFP_KERNEL); instance->length = size;

[PATCH] drm/amdgpu/smu10: Replace one-element array and use struct_size() helper

2020-05-19 Thread Gustavo A. R. Silva
The current codebase makes use of one-element arrays in the following form: struct something { int length; u8 data[1]; }; struct something *instance; instance = kmalloc(sizeof(*instance) + size, GFP_KERNEL); instance->length = size; memcpy(instance->data, source, size); but the