diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2025-11-10 10:24:09 +0100 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2025-11-24 20:22:21 +0100 |
| commit | 4f1b701f24bea0900e349aa1c860db24ba0150aa (patch) | |
| tree | b05539a5c2d3c39940eec0d5c968d67a338ee86c /include | |
| parent | 0a52d339d35df80d65706263dc55542dd795a115 (diff) | |
x86/bug: Use BUG_FORMAT for DEBUG_BUGVERBOSE_DETAILED
Since we have an explicit format string, use it for the condition string
instead of frobbing it in the file string.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251110115758.097401406@infradead.org
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-generic/bug.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 21d2c8f88d49..e512071216be 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h @@ -18,11 +18,13 @@ #define BUG_GET_TAINT(bug) ((bug)->flags >> 8) #endif +#ifndef WARN_CONDITION_STR #ifdef CONFIG_DEBUG_BUGVERBOSE_DETAILED -# define WARN_CONDITION_STR(cond_str) cond_str +# define WARN_CONDITION_STR(cond_str) "[" cond_str "] " #else # define WARN_CONDITION_STR(cond_str) #endif +#endif /* WARN_CONDITION_STR */ #ifndef __ASSEMBLY__ #include <linux/panic.h> @@ -107,7 +109,7 @@ extern __printf(1, 2) void __warn_printk(const char *fmt, ...); #define WARN_ON(condition) ({ \ int __ret_warn_on = !!(condition); \ if (unlikely(__ret_warn_on)) \ - __WARN_FLAGS("["#condition"] ", \ + __WARN_FLAGS(#condition, \ BUGFLAG_TAINT(TAINT_WARN)); \ unlikely(__ret_warn_on); \ }) @@ -117,7 +119,7 @@ extern __printf(1, 2) void __warn_printk(const char *fmt, ...); #define WARN_ON_ONCE(condition) ({ \ int __ret_warn_on = !!(condition); \ if (unlikely(__ret_warn_on)) \ - __WARN_FLAGS("["#condition"] ", \ + __WARN_FLAGS(#condition, \ BUGFLAG_ONCE | \ BUGFLAG_TAINT(TAINT_WARN)); \ unlikely(__ret_warn_on); \ |
