mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: linux-kernel@vger.kernel.org
Cc: x86@kernel.org, bp@alien8.de, mingo@redhat.com,
	tglx@linutronix.de, Ben Dooks <ben.dooks@codethink.co.uk>
Subject: [PATCH] x86/cpufeatures: fix build warnings with sparse of capflags.o
Date: Wed,  7 Jan 2026 10:06:03 +0000	[thread overview]
Message-ID: <20260107100603.152990-1-ben.dooks@codethink.co.uk> (raw)

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


                 reply	other threads:[~2026-01-07 10:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260107100603.152990-1-ben.dooks@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®