From: Chaitanya Kulkarni <kch@nvidia.com>
To: <linux-block@vger.kernel.org>
Cc: <axboe@kernel.dk>, Chaitanya Kulkarni <kch@nvidia.com>
Subject: [PATCH 2/2] brd: remove redundent prefix with pr_fmt macro
Date: Mon, 31 Jul 2023 19:29:29 -0700 [thread overview]
Message-ID: <20230801022929.8972-3-kch@nvidia.com> (raw)
In-Reply-To: <20230801022929.8972-1-kch@nvidia.com>
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@nvidia.com>
---
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
prev parent reply other threads:[~2023-08-01 2:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 2:29 [PATCH 0/2] brd: small improvements Chaitanya Kulkarni
2023-08-01 2:29 ` [PATCH 1/2] brd: use memcpy_to|from_page() in copy_to|from_brd() Chaitanya Kulkarni
2023-08-01 2:29 ` Chaitanya Kulkarni [this message]
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=20230801022929.8972-3-kch@nvidia.com \
--to=kch@nvidia.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.