public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Jens Axboe <axboe@kernel.dk>,
	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
	Hannes Reinecke <hare@suse.de>,
	Bodo Stroesser <bstroesser@ts.fujitsu.com>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Guoqing Jiang <guoqing.jiang@cloud.ionos.com>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	target-devel@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] target: pscsi: avoid Wempty-body warning
Date: Mon, 22 Mar 2021 17:38:51 +0100	[thread overview]
Message-ID: <20210322163851.GC23467@1wt.eu> (raw)
In-Reply-To: <CAK8P3a3f2vXBsEg_vWoc1qFBdy9dqO7txcwhpSTVCRBpGf9u=w@mail.gmail.com>

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@1wt.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

  reply	other threads:[~2021-03-22 16:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 11:44 [PATCH] target: pscsi: avoid Wempty-body warning Arnd Bergmann
2021-03-22 15:47 ` Christoph Hellwig
2021-03-22 15:53   ` Willy Tarreau
2021-03-22 16:18     ` Arnd Bergmann
2021-03-22 16:26       ` Willy Tarreau
2021-03-22 16:34         ` Arnd Bergmann
2021-03-22 16:38           ` Willy Tarreau [this message]
2021-03-23 17:24         ` David Laight
2021-03-22 16:06 ` Matthew Wilcox

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=20210322163851.GC23467@1wt.eu \
    --to=w@1wt.eu \
    --cc=arnd@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=bstroesser@ts.fujitsu.com \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=guoqing.jiang@cloud.ionos.com \
    --cc=hare@suse.de \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=target-devel@vger.kernel.org \
    --cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox