From: Joe Perches <joe@perches.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
Hugh Dickins <hughd@google.com>, Minchan Kim <minchan@kernel.org>,
Nitin Gupta <ngupta@vflare.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
cgroups@vger.kernel.org
Subject: Re: [PATCH] mm: Use fallthrough;
Date: Tue, 10 Mar 2020 04:10:29 -0700 [thread overview]
Message-ID: <7e2471ed71a42d74c0dbd9f2197034f5163d0eda.camel@perches.com> (raw)
In-Reply-To: <20200309064806.GB46830@google.com>
On Mon, 2020-03-09 at 15:48 +0900, Sergey Senozhatsky wrote:
> On (20/03/09 15:20), Sergey Senozhatsky wrote:
> [..]
> > > <shrug, maybe> I've no real opinion about that necessity.
> > >
> > > fallthrough commments are relatively rarely used as a
> > > separating element between case labels.
> > >
> > > It's by far most common to just have consecutive case labels
> > > without any other content.
> > >
> > > It's somewhere between 500:1 to 1000:1 in the kernel.
> >
> > I thought that those labels were used by some static code analysis
> > tools, so that the removal of some labels raised questions. But I
> > don't think I have opinions otherwise.
>
> ... I guess GCC counts as a static code analysis tool :)
>
> Looking at previous commits, people wanted to have proper 'fall through'
>
>
> Replace "fallthru" with a proper "fall through" annotation.
> This fix is part of the ongoing efforts to enabling
> -Wimplicit-fallthrough
>
> ---
>
> - case ZPOOL_MM_RW: /* fallthru */
> + case ZPOOL_MM_RW: /* fall through */
That conversion was unnecessary.
(there are still 6 /* fallthru */ comments in today's kernel)
There are tens of thousands of consecutive case labels without
interleaving fallthrough comments in the kernel like:
switch (foo) {
case BAR:
case BAZ:
do_something();
break;
default:
something_else();
break;
}
So gcc and clang handle consecutive cases without fallthrough
without uselessly emitting warnings just fine.
prev parent reply other threads:[~2020-03-10 11:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-07 7:58 Joe Perches
2020-03-07 18:53 ` Gustavo A. R. Silva
2020-03-08 3:16 ` Sergey Senozhatsky
2020-03-08 3:19 ` Joe Perches
2020-03-08 3:18 ` Sergey Senozhatsky
2020-03-08 3:54 ` Joe Perches
2020-03-09 4:15 ` Sergey Senozhatsky
2020-03-09 4:51 ` Joe Perches
2020-03-09 6:20 ` Sergey Senozhatsky
2020-03-09 6:48 ` Sergey Senozhatsky
2020-03-10 11:10 ` Joe Perches [this message]
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=7e2471ed71a42d74c0dbd9f2197034f5163d0eda.camel@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=minchan@kernel.org \
--cc=ngupta@vflare.org \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=sergey.senozhatsky@gmail.com \
--cc=vdavydov.dev@gmail.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