[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjSzuTyyBkmMDG4fx_sXzLJsh+9Xk-ubgbpJzJq_kzPsA@mail.gmail.com>
Date: Sat, 18 Apr 2020 11:53:03 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Randy Dunlap <rdunlap@...radead.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-input@...r.kernel.org, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org,
"J. Bruce Fields" <bfields@...ldses.org>,
Chuck Lever <chuck.lever@...cle.com>,
"open list:NFS, SUNRPC, AND..." <linux-nfs@...r.kernel.org>,
Johannes Berg <johannes@...solutions.net>,
Dan Williams <dan.j.williams@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Dave Jiang <dave.jiang@...el.com>,
linux-nvdimm <linux-nvdimm@...ts.01.org>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
linux-scsi <linux-scsi@...r.kernel.org>,
target-devel <target-devel@...r.kernel.org>,
Zzy Wysm <zzy@...wysm.com>
Subject: Re: [PATCH 2/9] fs: fix empty-body warning in posix_acl.c
On Sat, Apr 18, 2020 at 11:41 AM Randy Dunlap <rdunlap@...radead.org> wrote:
>
> Fix gcc empty-body warning when -Wextra is used:
Please don't do this.
First off, "do_empty()" adds nothing but confusion. Now it
syntactically looks like it does something, and it's a new pattern to
everybody. I've never seen it before.
Secondly, even if we were to do this, then the patch would be wrong:
> if (cmpxchg(p, ACL_NOT_CACHED, sentinel) != ACL_NOT_CACHED)
> - /* fall through */ ;
> + do_empty(); /* fall through */
That comment made little sense before, but it makes _no_ sense now.
What fall-through? I'm guessing it meant to say "nothing", and
somebody was confused. With "do_empty()", it's even more confusing.
Thirdly, there's a *reason* why "-Wextra" isn't used.
The warnings enabled by -Wextra are usually complete garbage, and
trying to fix them often makes the code worse. Exactly like here.
Linus
Powered by blists - more mailing lists