linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iscsi_ibft: convert printk() to pr_foo()
@ 2014-10-17 15:09 WANG Chao
  0 siblings, 0 replies; only message in thread
From: WANG Chao @ 2014-10-17 15:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: Peter Jones, Konrad Rzeszutek Wilk

Switch to pr_foo() and a common prefix ("iscsi_ibft: ") to each printk
message it generates. The printk message used to break down into multiple
lines, now squash these into a single string.

Along with this patch, use multiple MODULE_AUTHOR() marco as
recommended.

Signed-off-by: WANG Chao <chaowang@redhat.com>
---
 drivers/firmware/iscsi_ibft.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 071c2c9..5f9b307 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -67,6 +67,8 @@
  */
 
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/blkdev.h>
 #include <linux/capability.h>
 #include <linux/ctype.h>
@@ -87,8 +89,8 @@
 #define IBFT_ISCSI_VERSION "0.5.0"
 #define IBFT_ISCSI_DATE "2010-Feb-25"
 
-MODULE_AUTHOR("Peter Jones <pjones@redhat.com> and "
-	      "Konrad Rzeszutek <ketuzsezr@darnok.org>");
+MODULE_AUTHOR("Peter Jones <pjones@redhat.com>");
+MODULE_AUTHOR("Konrad Rzeszutek <ketuzsezr@darnok.org>");
 MODULE_DESCRIPTION("sysfs interface to BIOS iBFT information");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(IBFT_ISCSI_VERSION);
@@ -223,15 +225,13 @@ static ssize_t sprintf_string(char *str, int len, char *buf)
 static int ibft_verify_hdr(char *t, struct ibft_hdr *hdr, int id, int length)
 {
 	if (hdr->id != id) {
-		printk(KERN_ERR "iBFT error: We expected the %s " \
-				"field header.id to have %d but " \
-				"found %d instead!\n", t, id, hdr->id);
+		pr_err("iBFT error: We expected the %s field header.id to have %d but found %d instead!\n",
+				t, id, hdr->id);
 		return -ENODEV;
 	}
 	if (hdr->length != length) {
-		printk(KERN_ERR "iBFT error: We expected the %s " \
-				"field header.length to have %d but " \
-				"found %d instead!\n", t, length, hdr->length);
+		pr_err("iBFT error: We expected the %s field header.length to have %d but found %d instead!\n",
+				t, length, hdr->length);
 		return -ENODEV;
 	}
 
@@ -413,8 +413,7 @@ static int __init ibft_check_device(void)
 
 	/* Sanity checking of iBFT. */
 	if (ibft_addr->header.revision != 1) {
-		printk(KERN_ERR "iBFT module supports only revision 1, " \
-				"while this is %d.\n",
+		pr_err("iBFT module supports only revision 1, while this is %d.\n",
 				ibft_addr->header.revision);
 		return -ENOENT;
 	}
@@ -422,7 +421,7 @@ static int __init ibft_check_device(void)
 		csum += *pos;
 
 	if (csum) {
-		printk(KERN_ERR "iBFT has incorrect checksum (0x%x)!\n", csum);
+		pr_err("iBFT has incorrect checksum (0x%x)!\n", csum);
 		return -ENOENT;
 	}
 
@@ -646,9 +645,8 @@ static int __init ibft_create_kobject(struct acpi_table_ibft *header,
 		rc = 1;
 		break;
 	default:
-		printk(KERN_ERR "iBFT has unknown structure type (%d). " \
-				"Report this bug to %.6s!\n", hdr->id,
-				header->header.oem_id);
+		pr_err("iBFT has unknown structure type (%d). Report this bug to %.6s!\n",
+				hdr->id, header->header.oem_id);
 		rc = 1;
 		break;
 	}
@@ -703,7 +701,7 @@ static int __init ibft_register_kobjects(struct acpi_table_ibft *header)
 	/* iBFT table safety checking */
 	rc |= ((control->hdr.index) ? -ENODEV : 0);
 	if (rc) {
-		printk(KERN_ERR "iBFT error: Control header is invalid!\n");
+		pr_err("iBFT error: Control header is invalid!\n");
 		return rc;
 	}
 	for (ptr = &control->initiator_off; ptr < end; ptr += sizeof(u16)) {
@@ -809,7 +807,7 @@ static int __init ibft_init(void)
 		if (rc)
 			goto out_free;
 	} else
-		printk(KERN_INFO "No iBFT detected.\n");
+		pr_info("No iBFT detected.\n");
 
 	return 0;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-10-17 15:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-17 15:09 [PATCH] iscsi_ibft: convert printk() to pr_foo() WANG Chao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).