linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Joe Perches <joe@perches.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna.schumaker@netapp.com>
Cc: Nathan Chancellor <natechancellor@gmail.com>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Hongxiang Lou <louhongxiang@huawei.com>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	clang-built-linux@googlegroups.com
Subject: Re: [PATCH] nfs: remove incorrect fallthrough label
Date: Tue, 15 Sep 2020 19:01:14 -0500	[thread overview]
Message-ID: <de27c65b-ae7d-a2ba-3ab8-717c10f297c3@embeddedor.com> (raw)
In-Reply-To: <55f1ff08-fc3c-62ed-429d-c9ae285a3a49@embeddedor.com>



On 9/15/20 18:51, Gustavo A. R. Silva wrote:
> 
> 
> On 9/15/20 18:29, Joe Perches wrote:
>> On Tue, 2020-09-15 at 15:57 -0700, Nick Desaulniers wrote:
>>> There is no case after the default from which to fallthrough to. Clang
>>> will error in this case (unhelpfully without context, see link below)
>>> and GCC will with -Wswitch-unreachable.
>>>
>>> The previous commit should have just removed the comment.
>> []
>>> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
>> []
>>> @@ -889,7 +889,6 @@ static struct nfs_server *nfs_try_mount_request(struct fs_context *fc)
>>>  		default:
>>>  			if (rpcauth_get_gssinfo(flavor, &info) != 0)
>>>  				continue;
>>> -			fallthrough;
>>
>> My preference would be to convert the fallthrough
>> to a break here so if someone ever adds another
>> label after default: for any reason, the code would
>> still work as expected.
> 
> I agree with Joe.

Actually, this is part of the work I plan to do to enable -Wimplicit-fallthrough
for Clang: audit every place where we could use a break instead of a fallthrough.

I'm on vacation this week. So, I'll get back to this next week.

Thanks
--
Gustavo

  reply	other threads:[~2020-09-15 23:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 22:57 [PATCH] nfs: remove incorrect fallthrough label Nick Desaulniers
2020-09-15 23:29 ` Joe Perches
2020-09-15 23:51   ` Gustavo A. R. Silva
2020-09-16  0:01     ` Gustavo A. R. Silva [this message]
2020-09-16  0:33       ` Joe Perches
2020-09-16 20:02   ` [PATCH v2] " Nick Desaulniers
2020-09-16 20:18     ` Gustavo A. R. Silva
2020-09-16 20:19     ` Joe Perches
2020-09-17 21:41       ` Nick Desaulniers
2020-09-18  1:36         ` Joe Perches
2020-09-17 21:45       ` [PATCH v3] " Nick Desaulniers
2020-09-24 17:19         ` Nick Desaulniers
2020-09-24 17:40           ` Joe Perches
2020-09-24 18:07             ` Joe Perches
2020-09-24 18:11               ` Anna Schumaker
2020-09-25 11:27                 ` Mark Brown
2020-09-24 18:08           ` Gustavo A. R. Silva
2020-09-17  4:35     ` [PATCH v2] " Nathan Chancellor

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=de27c65b-ae7d-a2ba-3ab8-717c10f297c3@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=anna.schumaker@netapp.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=joe@perches.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=louhongxiang@huawei.com \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=trond.myklebust@hammerspace.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;
as well as URLs for NNTP newsgroup(s).