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

2020-05-22 Thread Gustavo A. R. Silva
On Fri, May 22, 2020 at 09:00:09AM +0200, Christian König wrote: > > +++ b/drivers/gpu/drm/radeon/ni_dpm.c > > @@ -2685,11 +2685,12 @@ static int ni_upload_sw_state(struct radeon_device > > *rdev, > > struct rv7xx_power_info *pi = rv770_get_pi(rdev); > > u16 address =

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

2020-05-22 Thread Christian König
Am 22.05.20 um 03:25 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;