lkml.org 
[lkml]   [2010]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -v3 1/4] printk, Add pr_pfx for library functions
Date
For library functions doing printk, the log level and line prefix
usually need to be specified by the caller. So this patch adds
"pr_pfx" to make the life of these library functions easier.

Signed-off-by: Huang Ying <ying.huang@intel.com>
---
include/linux/printk.h | 7 +++++++
1 file changed, 7 insertions(+)

--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -202,6 +202,13 @@ extern void print_hex_dump_bytes(const c
#endif

/*
+ * Used by library functions, where log level and line prefix need to
+ * be specifieded by the caller.
+ */
+#define pr_pfx(pfx, fmt, ...) \
+ printk("%s" fmt, pfx, ##__VA_ARGS__)
+
+/*
* ratelimited messages with local ratelimit_state,
* no local ratelimit_state used in the !PRINTK case
*/

\
 
 \ /
  Last update: 2010-12-02 09:09    [W:0.081 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site