File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -108,11 +108,14 @@ struct va_format {
108
108
* Dummy printk for disabled debugging statements to use whilst maintaining
109
109
* gcc's format checking.
110
110
*/
111
- #define no_printk (fmt , ...) \
112
- do { \
113
- if (0) \
114
- printk(fmt, ##__VA_ARGS__); \
115
- } while (0)
111
+ #define no_printk (fmt , ...) \
112
+ ({ \
113
+ do { \
114
+ if (0) \
115
+ printk(fmt, ##__VA_ARGS__); \
116
+ } while (0); \
117
+ 0; \
118
+ })
116
119
117
120
#ifdef CONFIG_EARLY_PRINTK
118
121
extern asmlinkage __printf (1 , 2 )
@@ -309,20 +312,24 @@ extern asmlinkage void dump_stack(void) __cold;
309
312
#define printk_once (fmt , ...) \
310
313
({ \
311
314
static bool __print_once __read_mostly; \
315
+ bool __ret_print_once = !__print_once; \
312
316
\
313
317
if (!__print_once) { \
314
318
__print_once = true; \
315
319
printk(fmt, ##__VA_ARGS__); \
316
320
} \
321
+ unlikely(__ret_print_once); \
317
322
})
318
323
#define printk_deferred_once (fmt , ...) \
319
324
({ \
320
325
static bool __print_once __read_mostly; \
326
+ bool __ret_print_once = !__print_once; \
321
327
\
322
328
if (!__print_once) { \
323
329
__print_once = true; \
324
330
printk_deferred(fmt, ##__VA_ARGS__); \
325
331
} \
332
+ unlikely(__ret_print_once); \
326
333
})
327
334
#else
328
335
#define printk_once (fmt , ...) \
You can’t perform that action at this time.
0 commit comments