From: Huang Ying <ying.huang@intel.com>
To: Len Brown <lenb@kernel.org>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <andi@firstfloor.org>,
Tony Luck <tony.luck@intel.com>,
ying.huang@intel.com, linux-acpi@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>
Subject: [PATCH -v3 1/4] printk, Add pr_pfx for library functions
Date: Thu, 2 Dec 2010 16:05:02 +0800 [thread overview]
Message-ID: <1291277105-31758-2-git-send-email-ying.huang@intel.com> (raw)
In-Reply-To: <1291277105-31758-1-git-send-email-ying.huang@intel.com>
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
*/
next prev parent reply other threads:[~2010-12-02 8:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-02 8:05 [PATCH -v3 0/4] ACPI, APEI, Report GHES error information via printk Huang Ying
2010-12-02 8:05 ` Huang Ying [this message]
2010-12-02 8:37 ` [PATCH -v3 1/4] printk, Add pr_pfx for library functions Joe Perches
2010-12-02 8:54 ` Huang Ying
2010-12-02 8:05 ` [PATCH -v3 2/4] Add CPER PCIe error section structure and constants definition Huang Ying
2010-12-02 8:05 ` [PATCH -v3 3/4] ACPI, APEI, Add APEI generic error status printing support Huang Ying
2010-12-02 8:05 ` [PATCH -v3 4/4] ACPI, APEI, Report GHES error information via printk Huang Ying
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1291277105-31758-2-git-send-email-ying.huang@intel.com \
--to=ying.huang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=tony.luck@intel.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox