linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] nbd: add missing definition of pr_fmt
@ 2022-07-23  8:24 Yu Kuai
  2022-07-25 20:25 ` Josef Bacik
  2022-07-25 23:01 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Yu Kuai @ 2022-07-23  8:24 UTC (permalink / raw)
  To: joe, josef, axboe, yukuai3, houtao1
  Cc: linux-block, nbd, linux-kernel, yukuai1, yi.zhang

From: Yu Kuai <yukuai3@huawei.com>

commit 1243172d5894 ("nbd: use pr_err to output error message") tries
to define pr_fmt and use short pr_err() to output error message,
however, the definition is missed.

This patch also remove existing "nbd:" inside pr_err().

Fixes: 1243172d5894 ("nbd: use pr_err to output error message")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
Changes in v2, suggested by Joe
 - move pr_fmt() to before any #include, so that #undef can be remove
 - remove existing "nbd:"

 drivers/block/nbd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index f5d098a148cb..2a709daefbc4 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -11,6 +11,8 @@
  * (part of code stolen from loop.c)
  */
 
+#define pr_fmt(fmt) "nbd: " fmt
+
 #include <linux/major.h>
 
 #include <linux/blkdev.h>
@@ -1950,7 +1952,7 @@ static int nbd_genl_connect(struct sk_buff *skb, struct genl_info *info)
 			     test_bit(NBD_DISCONNECT_REQUESTED, &nbd->flags)) ||
 			    !refcount_inc_not_zero(&nbd->refs)) {
 				mutex_unlock(&nbd_index_mutex);
-				pr_err("nbd: device at index %d is going down\n",
+				pr_err("device at index %d is going down\n",
 					index);
 				return -EINVAL;
 			}
@@ -1961,7 +1963,7 @@ static int nbd_genl_connect(struct sk_buff *skb, struct genl_info *info)
 	if (!nbd) {
 		nbd = nbd_dev_add(index, 2);
 		if (IS_ERR(nbd)) {
-			pr_err("nbd: failed to add new device\n");
+			pr_err("failed to add new device\n");
 			return PTR_ERR(nbd);
 		}
 	}
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] nbd: add missing definition of pr_fmt
  2022-07-23  8:24 [PATCH v2] nbd: add missing definition of pr_fmt Yu Kuai
@ 2022-07-25 20:25 ` Josef Bacik
  2022-07-25 23:01 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Josef Bacik @ 2022-07-25 20:25 UTC (permalink / raw)
  To: Yu Kuai
  Cc: joe, axboe, yukuai3, houtao1, linux-block, nbd, linux-kernel, yi.zhang

On Sat, Jul 23, 2022 at 04:24:27PM +0800, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@huawei.com>
> 
> commit 1243172d5894 ("nbd: use pr_err to output error message") tries
> to define pr_fmt and use short pr_err() to output error message,
> however, the definition is missed.
> 
> This patch also remove existing "nbd:" inside pr_err().
> 
> Fixes: 1243172d5894 ("nbd: use pr_err to output error message")
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] nbd: add missing definition of pr_fmt
  2022-07-23  8:24 [PATCH v2] nbd: add missing definition of pr_fmt Yu Kuai
  2022-07-25 20:25 ` Josef Bacik
@ 2022-07-25 23:01 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2022-07-25 23:01 UTC (permalink / raw)
  To: houtao1, yukuai1, josef, yukuai3, joe
  Cc: nbd, yi.zhang, linux-kernel, linux-block

On Sat, 23 Jul 2022 16:24:27 +0800, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@huawei.com>
> 
> commit 1243172d5894 ("nbd: use pr_err to output error message") tries
> to define pr_fmt and use short pr_err() to output error message,
> however, the definition is missed.
> 
> This patch also remove existing "nbd:" inside pr_err().
> 
> [...]

Applied, thanks!

[1/1] nbd: add missing definition of pr_fmt
      commit: b182198426ac3130f3543b1ad67855a84c4c5af2

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-25 23:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-23  8:24 [PATCH v2] nbd: add missing definition of pr_fmt Yu Kuai
2022-07-25 20:25 ` Josef Bacik
2022-07-25 23:01 ` Jens Axboe

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).