[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20260107100603.152990-1-ben.dooks@codethink.co.uk>
Date: Wed, 7 Jan 2026 10:06:03 +0000
From: Ben Dooks <ben.dooks@...ethink.co.uk>
To: linux-kernel@...r.kernel.org
Cc: x86@...nel.org,
bp@...en8.de,
mingo@...hat.com,
tglx@...utronix.de,
Ben Dooks <ben.dooks@...ethink.co.uk>
Subject: [PATCH] x86/cpufeatures: fix build warnings with sparse of capflags.o
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@...ethink.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
Powered by blists - more mailing lists