Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bug: Allow architectures to provide __WARN_printf()

In addition to providing __WARN_FLAGS(), allow an architecture to also
provide __WARN_printf().

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251110115757.807154591@infradead.org

+22 -15
+22 -15
include/asm-generic/bug.h
··· 100 100 const char *fmt, ...); 101 101 extern __printf(1, 2) void __warn_printk(const char *fmt, ...); 102 102 103 - #ifndef __WARN_FLAGS 104 - #define __WARN() __WARN_printf(TAINT_WARN, NULL) 105 - #define __WARN_printf(taint, arg...) do { \ 106 - instrumentation_begin(); \ 107 - warn_slowpath_fmt(__FILE__, __LINE__, taint, arg); \ 108 - instrumentation_end(); \ 109 - } while (0) 110 - #else 103 + #ifdef __WARN_FLAGS 111 104 #define __WARN() __WARN_FLAGS("", BUGFLAG_TAINT(TAINT_WARN)) 112 - 113 - #define __WARN_printf(taint, arg...) do { \ 114 - instrumentation_begin(); \ 115 - __warn_printk(arg); \ 116 - __WARN_FLAGS("", BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(taint));\ 117 - instrumentation_end(); \ 118 - } while (0) 119 105 120 106 #ifndef WARN_ON 121 107 #define WARN_ON(condition) ({ \ ··· 124 138 }) 125 139 #endif 126 140 #endif /* __WARN_FLAGS */ 141 + 142 + #if defined(__WARN_FLAGS) && !defined(__WARN_printf) 143 + #define __WARN_printf(taint, arg...) do { \ 144 + instrumentation_begin(); \ 145 + __warn_printk(arg); \ 146 + __WARN_FLAGS("", BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(taint));\ 147 + instrumentation_end(); \ 148 + } while (0) 149 + #endif 150 + 151 + #ifndef __WARN_printf 152 + #define __WARN_printf(taint, arg...) do { \ 153 + instrumentation_begin(); \ 154 + warn_slowpath_fmt(__FILE__, __LINE__, taint, arg); \ 155 + instrumentation_end(); \ 156 + } while (0) 157 + #endif 158 + 159 + #ifndef __WARN 160 + #define __WARN() __WARN_printf(TAINT_WARN, NULL) 161 + #endif 127 162 128 163 /* used internally by panic.c */ 129 164