Skip to content

Commit df3dc0e

Browse files
Dave Martinbp3tk0v
authored andcommitted
x86/resctrl: Prefer alloc(sizeof(*foo)) idiom in rdt_init_fs_context()
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 <[email protected]> Signed-off-by: James Morse <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Fenghua Yu <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Tested-by: Fenghua Yu <[email protected]> Tested-by: Peter Newman <[email protected]> Tested-by: Shaopeng Tan <[email protected]> Tested-by: Amit Singh Tomar <[email protected]> # arm64 Tested-by: Shanker Donthineni <[email protected]> # arm64 Tested-by: Babu Moger <[email protected]> Tested-by: Tony Luck <[email protected]> Link: https://lore.kernel.org/[email protected]
1 parent 556f48a commit df3dc0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/cpu/resctrl/rdtgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2951,7 +2951,7 @@ static int rdt_init_fs_context(struct fs_context *fc)
29512951
{
29522952
struct rdt_fs_context *ctx;
29532953

2954-
ctx = kzalloc(sizeof(struct rdt_fs_context), GFP_KERNEL);
2954+
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
29552955
if (!ctx)
29562956
return -ENOMEM;
29572957

0 commit comments

Comments
 (0)