]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/alternatives: Clean up preprocessor conditional block comments
authorIngo Molnar <mingo@kernel.org>
Wed, 26 Feb 2025 11:15:15 +0000 (12:15 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 26 Feb 2025 11:15:15 +0000 (12:15 +0100)
commit5d703825fde301677e8a79b0738927490407f435
treeffcd18eb681f7a9ab73e646302a23e330d72098c
parent500a41acb05a973cb6826ee56df082a97e210a95
x86/alternatives: Clean up preprocessor conditional block comments

When in the middle of a kernel source code file a kernel developer
sees a lone #else or #endif:

   ...

   #else

   ...

It's not obvious at a glance what those preprocessor blocks are
conditional on, if the starting #ifdef is outside visible range.

So apply the standard pattern we use in such cases elsewhere in
the kernel for large preprocessor blocks:

  #ifdef CONFIG_XXX
  ...
  ...
  ...
  #endif /* CONFIG_XXX */

  ...

  #ifdef CONFIG_XXX
  ...
  ...
  ...
  #else /* !CONFIG_XXX: */
  ...
  ...
  ...
  #endif /* !CONFIG_XXX */

( Note that in the  #else case we use the /* !CONFIG_XXX */ marker
  in the final #endif, not /* CONFIG_XXX */, which serves as an easy
  visual marker to differentiate #else or #elif related #endif closures
  from singular #ifdef/#endif blocks. )

Also clean up __CFI_DEFAULT definition with a bit more vertical alignment
applied, and a pointless tab converted to the standard space we use in
such definitions.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
arch/x86/kernel/alternative.c