Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Drop clang workaround for builtin constant checks

The CPU/MMU feature code has build-time checks that the feature value is
a builtin constant.

Back when the code was added clang wasn't able to compile the
checks, so an ifdef was added to avoid the checks for clang builds.
See commit b5fa0f7f88ed ("powerpc: Fix build failure with clang due
to BUILD_BUG_ON()")

These days clang 13 and later are able to build the checks successfully,
so drop the workaround.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240509121248.270878-1-mpe@ellerman.id.au

-4
-2
arch/powerpc/include/asm/cpu_has_feature.h
··· 24 24 { 25 25 int i; 26 26 27 - #ifndef __clang__ /* clang can't cope with this */ 28 27 BUILD_BUG_ON(!__builtin_constant_p(feature)); 29 - #endif 30 28 31 29 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG 32 30 if (!static_key_feature_checks_initialized) {
-2
arch/powerpc/include/asm/mmu.h
··· 239 239 { 240 240 int i; 241 241 242 - #ifndef __clang__ /* clang can't cope with this */ 243 242 BUILD_BUG_ON(!__builtin_constant_p(feature)); 244 - #endif 245 243 246 244 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG 247 245 if (!static_key_feature_checks_initialized) {