[tip: x86/misc] x86/bug: Put HAVE_ARCH_BUG_FORMAT_ARGS WARN definitions inside __ASSEMBLER__

From: tip-bot2 for Sean Christopherson

Date: Mon Apr 27 2026 - 15:05:14 EST


The following commit has been merged into the x86/misc branch of tip:

Commit-ID: 23aea3c539a62ab97ca3aecf41d590d91f2911fc
Gitweb: https://git.kernel.org/tip/23aea3c539a62ab97ca3aecf41d590d91f2911fc
Author: Sean Christopherson <seanjc@xxxxxxxxxx>
AuthorDate: Thu, 23 Apr 2026 07:54:18 -07:00
Committer: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
CommitterDate: Mon, 27 Apr 2026 12:02:57 -07:00

x86/bug: Put HAVE_ARCH_BUG_FORMAT_ARGS WARN definitions inside __ASSEMBLER__

Extend the !assembly #ifdef guarding x86's custom WARN helpers to cover the
WARN macros themselves, as they aren't assembly friendly. This helps make
it clear that things like __WARN_validate_printf() don't need a dummy
definition for assembly code.

No functional change intended.

Suggested-by: Yan Zhao <yan.y.zhao@xxxxxxxxx>
Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Signed-off-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Link: https://patch.msgid.link/20260423145419.459988-3-seanjc@xxxxxxxxxx
---
arch/x86/include/asm/bug.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index bf3c802..23ab054 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -154,7 +154,6 @@ struct arch_va_list {
};
extern void *__warn_args(struct arch_va_list *args, struct pt_regs *regs);
static __always_inline __printf(1, 2) void __WARN_validate_printf(const char *fmt, ...) { }
-#endif /* __ASSEMBLER__ */

#define __WARN_bug_entry(flags, format) ({ \
struct bug_entry *bug; \
@@ -189,6 +188,7 @@ do { \
} \
__ret_warn_on; \
})
+#endif /* __ASSEMBLER__ */

#endif /* HAVE_ARCH_BUG_FORMAT_ARGS */