From: Ali Nasrollahi <a.nasrolahi01@gmail.com>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
kees@kernel.org, peterz@infradead.org, nathan@kernel.org,
Ali Nasrollahi <A.Nasrolahi01@gmail.com>
Subject: [PATCH] x86/cfi: mark cfi_debug as __maybe_unused
Date: Mon, 16 Nov 2026 21:00:27 +0330 [thread overview]
Message-ID: <20261116173027.229752-1-A.Nasrolahi01@gmail.com> (raw)
When CONFIG_FINEIBT is disabled, cfi_debug is never read, but
alternative_instructions() still resets it after calling
__apply_fineibt(). Clang 23 diagnoses this as -Wunused-but-set-global
with W=1, causing a build failure when CONFIG_WERROR=y. Mark cfi_debug
as __maybe_unused to account for configurations without FineIBT.
Signed-off-by: Ali Nasrollahi <A.Nasrolahi01@gmail.com>
---
arch/x86/kernel/alternative.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index efbc11f8c336..cc2bdca06f81 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -1195,7 +1195,7 @@ void __init_or_module apply_seal_endbr(s32 *start, s32 *end) { }
#endif
enum cfi_mode cfi_mode __ro_after_init = __CFI_DEFAULT;
-static bool cfi_debug __ro_after_init;
+static bool cfi_debug __ro_after_init __maybe_unused;
#ifdef CONFIG_FINEIBT_BHI
bool cfi_bhi __ro_after_init = false;
--
2.56.1
reply other threads:[~2026-11-16 17:30 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=20261116173027.229752-1-A.Nasrolahi01@gmail.com \
--to=a.nasrolahi01@gmail.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=peterz@infradead.org \
--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®