All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] powerpc: Drop clang workaround for builtin constant checks
@ 2024-05-09 12:12 Michael Ellerman
  2024-05-09 12:12 ` [PATCH 2/3] powerpc/xmon: Fix disassembly CPU feature checks Michael Ellerman
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Michael Ellerman @ 2024-05-09 12:12 UTC (permalink / raw)
  To: linuxppc-dev

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 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>
---
 arch/powerpc/include/asm/cpu_has_feature.h | 2 --
 arch/powerpc/include/asm/mmu.h             | 2 --
 2 files changed, 4 deletions(-)

diff --git a/arch/powerpc/include/asm/cpu_has_feature.h b/arch/powerpc/include/asm/cpu_has_feature.h
index 0efabccd820c..92e24e979954 100644
--- a/arch/powerpc/include/asm/cpu_has_feature.h
+++ b/arch/powerpc/include/asm/cpu_has_feature.h
@@ -24,9 +24,7 @@ static __always_inline bool cpu_has_feature(unsigned long feature)
 {
 	int i;
 
-#ifndef __clang__ /* clang can't cope with this */
 	BUILD_BUG_ON(!__builtin_constant_p(feature));
-#endif
 
 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG
 	if (!static_key_feature_checks_initialized) {
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index 24f830cf9bb4..4ab9a630d943 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -246,9 +246,7 @@ static __always_inline bool mmu_has_feature(unsigned long feature)
 {
 	int i;
 
-#ifndef __clang__ /* clang can't cope with this */
 	BUILD_BUG_ON(!__builtin_constant_p(feature));
-#endif
 
 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG
 	if (!static_key_feature_checks_initialized) {
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-07-12 12:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-09 12:12 [PATCH 1/3] powerpc: Drop clang workaround for builtin constant checks Michael Ellerman
2024-05-09 12:12 ` [PATCH 2/3] powerpc/xmon: Fix disassembly CPU feature checks Michael Ellerman
2024-05-09 12:12 ` [PATCH 3/3] powerpc: Check only single values are passed to CPU/MMU " Michael Ellerman
2024-05-09 16:34   ` Segher Boessenkool
2024-05-10  6:45     ` Michael Ellerman
2024-05-10  8:07       ` Segher Boessenkool
2024-07-12 12:53 ` [PATCH 1/3] powerpc: Drop clang workaround for builtin constant checks Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.