lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 17 Jun 2015 01:30:12 +0000
From:	Wang Long <long.wanglong@...wei.com>
To:	<rjw@...ysocki.net>, <lenb@...nel.org>, <ying.huang@...el.com>,
	<joe@...ches.com>
CC:	<tony.luck@...el.com>, <bp@...e.de>, <gong.chen@...ux.intel.com>,
	<long.wanglong@...wei.com>, <tomasz.nowicki@...aro.org>,
	<lv.zheng@...el.com>, <linux-acpi@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <wanglong@...qinren.net>,
	<peifeiyue@...wei.com>
Subject: [PATCH v2 2/2] apei/erst-dbg: Define pr_fmt macro to avoid the duplication of ERST_DBG_PFX

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

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

diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c
index 3a57ffb..c38133a 100644
--- a/drivers/acpi/apei/erst-dbg.c
+++ b/drivers/acpi/apei/erst-dbg.c
@@ -23,6 +23,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/uaccess.h>
@@ -31,8 +33,6 @@
 
 #include "apei-internal.h"
 
-#define ERST_DBG_PFX			"ERST DBG: "
-
 #define ERST_DBG_RECORD_LEN_MAX		0x4000
 
 static void *erst_dbg_buf;
@@ -130,8 +130,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 +170,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 +222,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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ