[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210322163851.GC23467@1wt.eu>
Date: Mon, 22 Mar 2021 17:38:51 +0100
From: Willy Tarreau <w@....eu>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Christoph Hellwig <hch@...radead.org>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Jens Axboe <axboe@...nel.dk>,
Chaitanya Kulkarni <chaitanya.kulkarni@....com>,
Hannes Reinecke <hare@...e.de>,
Bodo Stroesser <bstroesser@...fujitsu.com>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Guoqing Jiang <guoqing.jiang@...ud.ionos.com>,
linux-scsi <linux-scsi@...r.kernel.org>,
target-devel@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] target: pscsi: avoid Wempty-body warning
On Mon, Mar 22, 2021 at 05:34:48PM +0100, Arnd Bergmann wrote:
> On Mon, Mar 22, 2021 at 5:26 PM Willy Tarreau <w@....eu> wrote:
> > On Mon, Mar 22, 2021 at 05:18:23PM +0100, Arnd Bergmann wrote:
> > > and a lot mostly harmless code like
> > >
> > > #ifdef DEBUG_THIS_DRIVER /* always disabled */
> > > #define dprintk(args...) printk(args)
> > > #else
> > > #define dprintk(args...)
> > > #endif
> > > /* note the mismatched format string */
> > > dprintk(KERN_WARNING "error %d\n", &object);
> > >
> > > Turning the empty dprintk() into no_printk() means we can catch
> > > the wrong format string during compile testing.
> >
> > Hmmm OK for this one. With this said, given how plenty of warnings seem
> > to consider indent and whatever, I wouldn't be surprised if a difference
> > is made between a totally empty body and one that results from an empty
> > macro. But indeed this one can represent a real bug.
>
> The -Wempty-body warning is actually really old and predates the compiler's
> understanding of indentation, we just always disabled it by default so far.
>
> As a lot of subsystems are W=1 clean these days, I just went for the
> final 26 patches to shut up all empty-body warnings in randconfig builds.
> Most of these were in the dprink() category, though none of this last set
> actually had incorrect format strings.
I agree that if it's only 26 patches on the whole kernel to re-enable one
warning it can be worth it for newcomers.
Willy
Powered by blists - more mailing lists