aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/printk.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/printk.h')
-rw-r--r--include/linux/printk.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 694925837a16..fa47e2708c01 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -5,6 +5,7 @@
5#include <linux/init.h> 5#include <linux/init.h>
6#include <linux/kern_levels.h> 6#include <linux/kern_levels.h>
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <linux/cache.h>
8 9
9extern const char linux_banner[]; 10extern const char linux_banner[];
10extern const char linux_proc_banner[]; 11extern const char linux_proc_banner[];
@@ -88,6 +89,13 @@ struct va_format {
88#define HW_ERR "[Hardware Error]: " 89#define HW_ERR "[Hardware Error]: "
89 90
90/* 91/*
92 * DEPRECATED
93 * Add this to a message whenever you want to warn user space about the use
94 * of a deprecated aspect of an API so they can stop using it
95 */
96#define DEPRECATED "[Deprecated]: "
97
98/*
91 * Dummy printk for disabled debugging statements to use whilst maintaining 99 * Dummy printk for disabled debugging statements to use whilst maintaining
92 * gcc's format and side-effect checking. 100 * gcc's format and side-effect checking.
93 */ 101 */
@@ -253,17 +261,17 @@ extern asmlinkage void dump_stack(void) __cold;
253 */ 261 */
254 262
255#ifdef CONFIG_PRINTK 263#ifdef CONFIG_PRINTK
256#define printk_once(fmt, ...) \ 264#define printk_once(fmt, ...) \
257({ \ 265({ \
258 static bool __print_once; \ 266 static bool __print_once __read_mostly; \
259 \ 267 \
260 if (!__print_once) { \ 268 if (!__print_once) { \
261 __print_once = true; \ 269 __print_once = true; \
262 printk(fmt, ##__VA_ARGS__); \ 270 printk(fmt, ##__VA_ARGS__); \
263 } \ 271 } \
264}) 272})
265#else 273#else
266#define printk_once(fmt, ...) \ 274#define printk_once(fmt, ...) \
267 no_printk(fmt, ##__VA_ARGS__) 275 no_printk(fmt, ##__VA_ARGS__)
268#endif 276#endif
269 277