* [PATCH] x86/cpufeatures: fix build warnings with sparse of capflags.o
@ 2026-01-07 10:06 Ben Dooks
0 siblings, 0 replies; only message in thread
From: Ben Dooks @ 2026-01-07 10:06 UTC (permalink / raw)
To: linux-kernel; +Cc: x86, bp, mingo, tglx, Ben Dooks
It seems that sparse builds don't define __KERNEL__ which means
the check step of capflags.c is triggering the following sparse
warnings. Fix this by checking for __CHECKER__ in addition to the
__KERNEL__ check.
Fixes the following sparse warnings:
arch/x86/kernel/cpu/capflags.c:5:12: warning: symbol 'x86_cap_flags' was not declared. Should it be static?
arch/x86/kernel/cpu/capflags.c:295:12: warning: symbol 'x86_bug_flags' was not declared. Should it be static?
arch/x86/kernel/cpu/capflags.c:343:12: warning: symbol 'x86_vmx_flags' was not declared. Should it be static?
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
arch/x86/include/asm/cpufeature.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 3ddc1d33399b..484553adc27d 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -4,7 +4,7 @@
#include <asm/processor.h>
-#if defined(__KERNEL__) && !defined(__ASSEMBLER__)
+#if (defined(__KERNEL__) || defined(__CHECKER__)) && !defined(__ASSEMBLER__)
#include <asm/asm.h>
#include <linux/bitops.h>
--
2.37.2.352.g3c44437643
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-07 10:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-07 10:06 [PATCH] x86/cpufeatures: fix build warnings with sparse of capflags.o Ben Dooks
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®