From: Yu Kuai <yukuai3@huawei.com>
To: Yu Kuai <yukuai1@huaweicloud.com>, Joe Perches <joe@perches.com>,
<josef@toxicpanda.com>, <axboe@kernel.dk>, <houtao1@huawei.com>
Cc: <linux-block@vger.kernel.org>, <nbd@other.debian.org>,
<linux-kernel@vger.kernel.org>, <yi.zhang@huawei.com>
Subject: Re: [PATCH] nbd: add missing definition of pr_fmt
Date: Sat, 23 Jul 2022 10:14:30 +0800 [thread overview]
Message-ID: <4e6a80cb-63fa-660c-8acf-f25062800238@huawei.com> (raw)
In-Reply-To: <0dba2f0c-ba02-853e-60e7-873eabedcd80@huaweicloud.com>
Hi!
在 2022/07/20 19:46, Yu Kuai 写道:
> Hi !
>
> 在 2022/07/18 22:32, Joe Perches 写道:
>> On Mon, 2022-07-18 at 21:52 +0800, Yu Kuai wrote:
>>> 在 2022/07/06 17:33, Yu Kuai 写道:
>>>> 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.
>>> friendly ping ...
>> []
>>>> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
>> []
>>>> @@ -44,6 +44,9 @@
>>>> #include <linux/nbd-netlink.h>
>>>> #include <net/genetlink.h>
>>>> +#undef pr_fmt
>>>> +#define pr_fmt(fmt) "nbd: " fmt
>>>> +
I tried to remove the #undef:
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -44,7 +44,6 @@
#include <linux/nbd-netlink.h>
#include <net/genetlink.h>
#define pr_fmt(fmt) "nbd: " fmt
And then following warning is triggered:
drivers/block/nbd.c:47: warning: "pr_fmt" redefined
47 | #define pr_fmt(fmt) "nbd: " fmt
It semms that keeping that #undef is the right thing to do.
Thanks,
Kuai
>> Typically, this #define is place before all #include lines
>> so there is no need for an #undef
>
> Thanks for you advice, I'll do that in v2.
>
> Kuai
>
> .
>
next prev parent reply other threads:[~2022-07-23 2:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 9:33 Yu Kuai
2022-07-18 13:52 ` Yu Kuai
2022-07-18 14:32 ` Joe Perches
2022-07-20 11:46 ` Yu Kuai
2022-07-23 2:14 ` Yu Kuai [this message]
2022-07-23 2:15 ` Yu Kuai
2022-07-23 3:12 ` Joe Perches
2022-07-23 4:08 ` Yu Kuai
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=4e6a80cb-63fa-660c-8acf-f25062800238@huawei.com \
--to=yukuai3@huawei.com \
--cc=axboe@kernel.dk \
--cc=houtao1@huawei.com \
--cc=joe@perches.com \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nbd@other.debian.org \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@huaweicloud.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®