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

Reinette Chatre
2025-03-07T05:06:48Z

Hi James,

On 2/28/25 11:59 AM, James Morse wrote:
> From: Dave Martin <Dave.Martin@arm.com>
>
> 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@arm.com>
> Signed-off-by: James Morse <james.morse@arm.com>
> ---

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

Reinette