x86/alternatives: Fix switch block in apply_reloc()
PATCH 1/1 x86/alternatives: Fix switch block in apply_reloc()
Adhere to Linux kernel coding style
Reported by checkpatch:
ERROR: trailing statements should be on next line
+ case 1: apply_reloc_n(8, ptr, diff); break;
ERROR: trailing statements should be on next line
+ case 2: apply_reloc_n(16, ptr, diff); break;
ERROR: trailing statements should be on next line
+ case 4: apply_reloc_n(32, ptr, diff); break;
ERROR: trailing statements should be on next line
+ default: BUG();
--- arch/x86/kernel/alternative.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
arch/x86/kernel/alternative.c +11 -4
@@ -297,10 +297,17 @@ static __always_inlinevoid apply_reloc (int n,void *ptr,uintptr_t diff) {switch (n) { -case 1 :apply_reloc_n (8 , ptr, diff);break ; -case 2 :apply_reloc_n (16 , ptr, diff);break ; -case 4 :apply_reloc_n (32 , ptr, diff);break ; -default :BUG (); +case 1 : +apply_reloc_n (8 , ptr, diff); +break ; +case 2 : +apply_reloc_n (16 , ptr, diff); +break ; +case 4 : +apply_reloc_n (32 , ptr, diff); +break ; +default : +BUG (); } }
Signature · 1 line
2.34.1
Borislav Petkov
maintainerarch/x86/kernel/alternative.c static __always_inline · line 303
Quoted 4 lines · Pranav Athreya
arch/x86/kernel/alternative.c +0
-4-case 1 :apply_reloc_n (8 , ptr, diff);break ; -case 2 :apply_reloc_n (16 , ptr, diff);break ; -case 4 :apply_reloc_n (32 , ptr, diff);break ; -default :BUG ();
It is more compact and faster readable this way. Do not always take what checkpatch tells you to the letter.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteQuoted 2 lines · Borislav Petkov
It is more compact and faster readable this way. Do not always take what checkpatch tells you to the letter.
Understood. Thank you for the feedback, Boris.
Regards,
Pranav