summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/bug.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/bug.h')
-rw-r--r--arch/x86/include/asm/bug.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index 80c1696d8d59..23ab05438269 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -153,7 +153,7 @@ struct arch_va_list {
struct sysv_va_list args;
};
extern void *__warn_args(struct arch_va_list *args, struct pt_regs *regs);
-#endif /* __ASSEMBLER__ */
+static __always_inline __printf(1, 2) void __WARN_validate_printf(const char *fmt, ...) { }
#define __WARN_bug_entry(flags, format) ({ \
struct bug_entry *bug; \
@@ -172,6 +172,7 @@ extern void *__warn_args(struct arch_va_list *args, struct pt_regs *regs);
#define __WARN_print_arg(flags, format, arg...) \
do { \
int __flags = (flags) | BUGFLAG_WARNING | BUGFLAG_ARGS ; \
+ __WARN_validate_printf(format, ## arg); \
static_call_mod(WARN_trap)(__WARN_bug_entry(__flags, format), ## arg); \
asm (""); /* inhibit tail-call optimization */ \
} while (0)
@@ -187,6 +188,7 @@ do { \
} \
__ret_warn_on; \
})
+#endif /* __ASSEMBLER__ */
#endif /* HAVE_ARCH_BUG_FORMAT_ARGS */