mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wang Long <long.wanglong@huawei.com>
To: <rjw@rjwysocki.net>, <lenb@kernel.org>, <ying.huang@intel.com>
Cc: <tony.luck@intel.com>, <bp@suse.de>, <gong.chen@linux.intel.com>,
	<long.wanglong@huawei.com>, <tomasz.nowicki@linaro.org>,
	<lv.zheng@intel.com>, <linux-acpi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <wanglong@laoqinren.net>,
	<peifeiyue@huawei.com>
Subject: [PATCH 2/2] apei/erst-dbg: Define pr_fmt macro to avoid the duplication of ERST_DBG_PFX
Date: Mon, 15 Jun 2015 09:57:30 +0000	[thread overview]
Message-ID: <1434362250-217135-2-git-send-email-long.wanglong@huawei.com> (raw)
In-Reply-To: <1434362250-217135-1-git-send-email-long.wanglong@huawei.com>

Define pr_fmt macro with {ERST DBG: } prefix, then remove all use
of ERST_DBG_PFXin the pr_* functions.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
---
 drivers/acpi/apei/erst-dbg.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c
index 3a57ffb..48e9490 100644
--- a/drivers/acpi/apei/erst-dbg.c
+++ b/drivers/acpi/apei/erst-dbg.c
@@ -31,7 +31,8 @@
 
 #include "apei-internal.h"
 
-#define ERST_DBG_PFX			"ERST DBG: "
+#undef pr_fmt
+#define pr_fmt(fmt) "ERST DBG: " fmt
 
 #define ERST_DBG_RECORD_LEN_MAX		0x4000
 
@@ -130,8 +131,7 @@ retry:
 	if (rc < 0)
 		goto out;
 	if (len > ERST_DBG_RECORD_LEN_MAX) {
-		pr_warn(ERST_DBG_PFX
-			   "Record (ID: 0x%llx) length is too long: %zd\n",
+		pr_warn("Record (ID: 0x%llx) length is too long: %zd\n",
 			   id, len);
 		rc = -EIO;
 		goto out;
@@ -171,7 +171,7 @@ static ssize_t erst_dbg_write(struct file *filp, const char __user *ubuf,
 		return -EPERM;
 
 	if (usize > ERST_DBG_RECORD_LEN_MAX) {
-		pr_err(ERST_DBG_PFX "Too long record to be written\n");
+		pr_err("Too long record to be written\n");
 		return -EINVAL;
 	}
 
@@ -223,7 +223,7 @@ static struct miscdevice erst_dbg_dev = {
 static __init int erst_dbg_init(void)
 {
 	if (erst_disable) {
-		pr_info(ERST_DBG_PFX "ERST support is disabled.\n");
+		pr_info("ERST support is disabled.\n");
 		return -ENODEV;
 	}
 	return misc_register(&erst_dbg_dev);
-- 
1.8.3.4


  reply	other threads:[~2015-06-15  9:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15  9:57 [PATCH 1/2] apei/*.c: use pr_warn instead of pr_warning Wang Long
2015-06-15  9:57 ` Wang Long [this message]
2015-06-15 14:42   ` [PATCH 2/2] apei/erst-dbg: Define pr_fmt macro to avoid the duplication of ERST_DBG_PFX Joe Perches
2015-06-17  1:31     ` long.wanglong

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=1434362250-217135-2-git-send-email-long.wanglong@huawei.com \
    --to=long.wanglong@huawei.com \
    --cc=bp@suse.de \
    --cc=gong.chen@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=peifeiyue@huawei.com \
    --cc=rjw@rjwysocki.net \
    --cc=tomasz.nowicki@linaro.org \
    --cc=tony.luck@intel.com \
    --cc=wanglong@laoqinren.net \
    --cc=ying.huang@intel.com \
    /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

all inboxes | Powered by JetHome®