summaryrefslogtreecommitdiffstats
path: root/include/printk.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-01-26 12:57:06 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-01-27 14:24:39 +0100
commit56d28b932308da23a9e14c1f8f107119d36b245c (patch)
tree71b6acd564c10ace285b54c0fcd2574ec2b09a48 /include/printk.h
parentf331ac288f93d52bdcee4330f20b8e79ccad5eb1 (diff)
downloadbarebox-56d28b932308da23a9e14c1f8f107119d36b245c.tar.gz
barebox-56d28b932308da23a9e14c1f8f107119d36b245c.tar.xz
introduce pr_fmt
With this the files can give more context to their pr_* messages by specifying a at the beginning of the files. Basically the same mechanism as in the Kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/printk.h')
-rw-r--r--include/printk.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/include/printk.h b/include/printk.h
index 82be308a27..1d45616f54 100644
--- a/include/printk.h
+++ b/include/printk.h
@@ -55,14 +55,18 @@ int dev_printf(const struct device_d *dev, const char *format, ...)
ret; \
})
-#define pr_emerg(fmt, arg...) __pr_printk(0, fmt, ##arg)
-#define pr_alert(fmt, arg...) __pr_printk(1, fmt, ##arg)
-#define pr_crit(fmt, arg...) __pr_printk(2, fmt, ##arg)
-#define pr_warning(fmt, arg...) __pr_printk(3, fmt, ##arg)
-#define pr_err(fmt, arg...) __pr_printk(4, fmt, ##arg)
-#define pr_notice(fmt, arg...) __pr_printk(5, fmt, ##arg)
-#define pr_info(fmt, arg...) __pr_printk(6, fmt, ##arg)
-#define pr_debug(fmt, arg...) __pr_printk(7, fmt, ##arg)
-#define debug(fmt, arg...) __pr_printk(7, fmt, ##arg)
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+
+#define pr_emerg(fmt, arg...) __pr_printk(0, pr_fmt(fmt), ##arg)
+#define pr_alert(fmt, arg...) __pr_printk(1, pr_fmt(fmt), ##arg)
+#define pr_crit(fmt, arg...) __pr_printk(2, pr_fmt(fmt), ##arg)
+#define pr_warning(fmt, arg...) __pr_printk(3, pr_fmt(fmt), ##arg)
+#define pr_err(fmt, arg...) __pr_printk(4, pr_fmt(fmt), ##arg)
+#define pr_notice(fmt, arg...) __pr_printk(5, pr_fmt(fmt), ##arg)
+#define pr_info(fmt, arg...) __pr_printk(6, pr_fmt(fmt), ##arg)
+#define pr_debug(fmt, arg...) __pr_printk(7, pr_fmt(fmt), ##arg)
+#define debug(fmt, arg...) __pr_printk(7, pr_fmt(fmt), ##arg)
#endif