cpu: microcode: Add comma to 0
Subsystems (2)
PATCH 1/1 cpu: microcode: Add comma to 0
Add "," after 0
Because memory for the struct is being cleared
and elements after "," are missing on purpose
as they are being cleared to
Recommended by Boris Petkov
--- arch/x86/kernel/cpu/microcode/amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/microcode/amd.c +1 -1
@@ -418,7 +418,7 @@ static int __apply_microcode_amd(struct microcode_amd *mc)static bool apply_microcode_early_amd (u32 cpuid_1_eax,void *ucode,size_t size,bool save_patch) { -struct cont_desc desc = {0 }; +struct cont_desc desc = {0 , };u8 (*patch)[PATCH_MAX_SIZE ];struct microcode_amd *mc;u32 rev, dummy, *new_rev;
Signature · 1 line
2.23.0
Quoted 17 lines · Jules Irenge
Add "," after 0
Because memory for the struct is being cleared
and elements after "," are missing on purpose
as they are being cleared toRecommended by Boris Petkov
Signed-off-by Jules Irenge <[email protected]>--- arch/x86/kernel/cpu/microcode/amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/cpu/microcode/amd.c +0
-0
arch/x86/kernel/cpu/microcode/amd.c static int __apply_microcode_amd(struct microcode_amd *mc) · line 421
Quoted 5 lines
arch/x86/kernel/cpu/microcode/amd.c +1
-1@@ -418,7 +418,7 @@ static int __apply_microcode_amd(struct microcode_amd *mc)static bool apply_microcode_early_amd (u32 cpuid_1_eax,void *ucode,size_t size,bool save_patch) { -struct cont_desc desc = {0 }; +struct cont_desc desc = {0 , };
This is 100% unnecessary - " = { }" is enough of a structure initializer.
Thanks,
Ingo
Borislav Petkov
maintainerQuoted 15 lines · Ingo Molnar
Quoted 12 lines · Jules Irenge
Add "," after 0
Because memory for the struct is being cleared
and elements after "," are missing on purpose
as they are being cleared toRecommended by Boris Petkov
Signed-off-by Jules Irenge <[email protected]>--- arch/x86/kernel/cpu/microcode/amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines
arch/x86/kernel/cpu/microcode/amd.c static int __apply_microcode_amd(struct microcode_amd *mc) · line 421
Quoted 10 lines
arch/x86/kernel/cpu/microcode/amd.c +1
-1@@ -418,7 +418,7 @@ static int __apply_microcode_amd(struct microcode_amd *mc)static bool apply_microcode_early_amd (u32 cpuid_1_eax,void *ucode,size_t size,bool save_patch) { -struct cont_desc desc = {0 }; +struct cont_desc desc = {0 , };This is 100% unnecessary - " = { }" is enough of a structure initializer.
That was my initial thought but empty initializers are not ISO C compliant, I've been told.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteQuoted 29 lines · Borislav Petkov
Quoted 15 lines · Ingo Molnar
Quoted 12 lines · Jules Irenge
Add "," after 0
Because memory for the struct is being cleared
and elements after "," are missing on purpose
as they are being cleared toRecommended by Boris Petkov
Signed-off-by Jules Irenge <[email protected]>--- arch/x86/kernel/cpu/microcode/amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 12 lines
arch/x86/kernel/cpu/microcode/amd.c static int __apply_microcode_amd(struct microcode_amd *mc) · line 421
Quoted 10 lines
arch/x86/kernel/cpu/microcode/amd.c +1
-1@@ -418,7 +418,7 @@ static int __apply_microcode_amd(struct microcode_amd *mc)static bool apply_microcode_early_amd (u32 cpuid_1_eax,void *ucode,size_t size,bool save_patch) { -struct cont_desc desc = {0 }; +struct cont_desc desc = {0 , };This is 100% unnecessary - " = { }" is enough of a structure initializer.
Quoted 2 lines
That was my initial thought but empty initializers are not ISO C compliant, I've been told.
Yeah, but the kernel isn't ISO C, and the hive mind has spoken in favor of the shortest variant:
dagon:~/tip> git grep '= { }' | wc -l
647
dagon:~/tip> git grep '= { 0, }' | wc -l
231
dagon:~/tip> git grep '= { NULL, }' | wc -l
38
:-)
Thanks,
Ingo
Borislav Petkov
maintainerQuoted 6 lines · Ingo Molnar
Yeah, but the kernel isn't ISO C, and the hive mind has spoken in favor of the shortest variant:
dagon:~/tip> git grep '= { }' | wc -l
647
Quoted 7 lines
dagon:~/tip> git grep '= { 0, }' | wc -l
231dagon:~/tip> git grep '= { NULL, }' | wc -l
38:-)
Ok then, keeping it as is.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette