aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h42
1 files changed, 23 insertions, 19 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 69a9bfdf9c86..6a5c75cee5bc 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -327,32 +327,36 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
327 return buf; 327 return buf;
328} 328}
329 329
330#define pr_emerg(fmt, arg...) \ 330#ifndef pr_fmt
331 printk(KERN_EMERG fmt, ##arg) 331#define pr_fmt(fmt) fmt
332#define pr_alert(fmt, arg...) \ 332#endif
333 printk(KERN_ALERT fmt, ##arg) 333
334#define pr_crit(fmt, arg...) \ 334#define pr_emerg(fmt, ...) \
335 printk(KERN_CRIT fmt, ##arg) 335 printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
336#define pr_err(fmt, arg...) \ 336#define pr_alert(fmt, ...) \
337 printk(KERN_ERR fmt, ##arg) 337 printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
338#define pr_warning(fmt, arg...) \ 338#define pr_crit(fmt, ...) \
339 printk(KERN_WARNING fmt, ##arg) 339 printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
340#define pr_notice(fmt, arg...) \ 340#define pr_err(fmt, ...) \
341 printk(KERN_NOTICE fmt, ##arg) 341 printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
342#define pr_info(fmt, arg...) \ 342#define pr_warning(fmt, ...) \
343 printk(KERN_INFO fmt, ##arg) 343 printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
344#define pr_notice(fmt, ...) \
345 printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
346#define pr_info(fmt, ...) \
347 printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
344 348
345/* If you are writing a driver, please use dev_dbg instead */ 349/* If you are writing a driver, please use dev_dbg instead */
346#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) 350#if defined(CONFIG_DYNAMIC_PRINTK_DEBUG)
347#define pr_debug(fmt, ...) do { \ 351#define pr_debug(fmt, ...) do { \
348 dynamic_pr_debug(fmt, ##__VA_ARGS__); \ 352 dynamic_pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \
349 } while (0) 353 } while (0)
350#elif defined(DEBUG) 354#elif defined(DEBUG)
351#define pr_debug(fmt, arg...) \ 355#define pr_debug(fmt, ...) \
352 printk(KERN_DEBUG fmt, ##arg) 356 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
353#else 357#else
354#define pr_debug(fmt, arg...) \ 358#define pr_debug(fmt, ...) \
355 ({ if (0) printk(KERN_DEBUG fmt, ##arg); 0; }) 359 ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; })
356#endif 360#endif
357 361
358/* 362/*