lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4e6a80cb-63fa-660c-8acf-f25062800238@huawei.com>
Date:   Sat, 23 Jul 2022 10:14:30 +0800
From:   Yu Kuai <yukuai3@...wei.com>
To:     Yu Kuai <yukuai1@...weicloud.com>, Joe Perches <joe@...ches.com>,
        <josef@...icpanda.com>, <axboe@...nel.dk>, <houtao1@...wei.com>
CC:     <linux-block@...r.kernel.org>, <nbd@...er.debian.org>,
        <linux-kernel@...r.kernel.org>, <yi.zhang@...wei.com>
Subject: Re: [PATCH] nbd: add missing definition of pr_fmt

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@...wei.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
> 
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ