Re: [PATCH][next] amd/amdgpu_ctx: Use struct_size() helper and kmalloc()

2020-10-09 Thread Gustavo A. R. Silva
On Fri, Oct 09, 2020 at 04:29:55PM +0200, Christian König wrote: > > > > - entity = kcalloc(1, offsetof(typeof(*entity), > > > > fences[amdgpu_sched_jobs]), > > > > + entity = kmalloc(struct_size(entity, fences, amdgpu_sched_jobs), > > > NAK. You could use kzalloc() here, but kmalloc

Re: [PATCH][next] amd/amdgpu_ctx: Use struct_size() helper and kmalloc()

2020-10-09 Thread Christian König
Am 09.10.20 um 15:54 schrieb Gustavo A. R. Silva: On Fri, Oct 09, 2020 at 09:08:51AM +0200, Christian König wrote: Am 08.10.20 um 16:34 schrieb Gustavo A. R. Silva: Make use of the new struct_size() helper instead of the offsetof() idiom. Also, use kmalloc() instead of kcalloc().

Re: [PATCH][next] amd/amdgpu_ctx: Use struct_size() helper and kmalloc()

2020-10-09 Thread Gustavo A. R. Silva
On Fri, Oct 09, 2020 at 09:08:51AM +0200, Christian König wrote: > Am 08.10.20 um 16:34 schrieb Gustavo A. R. Silva: > > Make use of the new struct_size() helper instead of the offsetof() idiom. > > Also, use kmalloc() instead of kcalloc(). > > > > Signed-off-by: Gustavo A. R. Silva > > --- > >

Re: [PATCH][next] amd/amdgpu_ctx: Use struct_size() helper and kmalloc()

2020-10-09 Thread Christian König
Am 08.10.20 um 16:34 schrieb Gustavo A. R. Silva: Make use of the new struct_size() helper instead of the offsetof() idiom. Also, use kmalloc() instead of kcalloc(). Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH][next] amd/amdgpu_ctx: Use struct_size() helper and kmalloc()

2020-10-08 Thread Alex Deucher
Applied. Thanks! Alex On Thu, Oct 8, 2020 at 10:29 AM Gustavo A. R. Silva wrote: > > Make use of the new struct_size() helper instead of the offsetof() idiom. > Also, use kmalloc() instead of kcalloc(). > > Signed-off-by: Gustavo A. R. Silva > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c |

[PATCH][next] amd/amdgpu_ctx: Use struct_size() helper and kmalloc()

2020-10-08 Thread Gustavo A. R. Silva
Make use of the new struct_size() helper instead of the offsetof() idiom. Also, use kmalloc() instead of kcalloc(). Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git