[PATCH 2/2] brd: remove redundent prefix with pr_fmt macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Define pr_fmt to "brd: " in order to remove the duplicate brd prefix
that makes pr_xxx() longer than it's needed. Note that this practice
is been followed in most of the kernel module for the consistency of
the driver messages so they become easy to grep/debug and not duplicate
driver name in the pr_xxx() messages,

Signed-off-by: Chaitanya Kulkarni <kch@xxxxxxxxxx>
---
 drivers/block/brd.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index d878a7dc616b..23eea3a35438 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -27,6 +27,9 @@
 
 #include <linux/uaccess.h>
 
+#undef pr_fmt
+#define pr_fmt(fmt)	"brd: " fmt
+
 /*
  * Each block ramdisk device has a xarray brd_pages of pages that stores
  * the pages containing the block device's contents. A brd page's ->index is
@@ -397,7 +400,7 @@ static inline void brd_check_and_reset_par(void)
 		max_part = 1UL << fls(max_part);
 
 	if (max_part > DISK_MAX_PARTS) {
-		pr_info("brd: max_part can't be larger than %d, reset max_part = %d.\n",
+		pr_info("max_part can't be larger than %d, reset max_part = %d.\n",
 			DISK_MAX_PARTS, DISK_MAX_PARTS);
 		max_part = DISK_MAX_PARTS;
 	}
@@ -437,13 +440,13 @@ static int __init brd_init(void)
 		goto out_free;
 	}
 
-	pr_info("brd: module loaded\n");
+	pr_info("module loaded\n");
 	return 0;
 
 out_free:
 	brd_cleanup();
 
-	pr_info("brd: module NOT loaded !!!\n");
+	pr_info("module NOT loaded !!!\n");
 	return err;
 }
 
@@ -453,7 +456,7 @@ static void __exit brd_exit(void)
 	unregister_blkdev(RAMDISK_MAJOR, "ramdisk");
 	brd_cleanup();
 
-	pr_info("brd: module unloaded\n");
+	pr_info("module unloaded\n");
 }
 
 module_init(brd_init);
-- 
2.40.0




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux