Re: [PATCH v7 43/49] x86/resctrl: Prefer alloc(sizeof(*foo)) idiom in rdt_init_fs_context()

From: Reinette Chatre
Date: Fri Mar 07 2025 - 00:07:00 EST


Hi James,

On 2/28/25 11:59 AM, James Morse wrote:
> From: Dave Martin <Dave.Martin@xxxxxxx>
>
> rdt_init_fs_context() sizes a typed allocation using an explicit
> sizeof(type) expression, which checkpatch.pl complains about.
>
> Since this code is about to be factored out and made generic, this
> is a good opportunity to fix the code to size the allocation based
> on the target pointer instead, to reduce the chance of future mis-
> maintenance.
>
> Fix it.
>
> No functional change.
>
> Signed-off-by: Dave Martin <Dave.Martin@xxxxxxx>
> Signed-off-by: James Morse <james.morse@xxxxxxx>
> ---

Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Reinette