Commit fb08334b authored by Nick Desaulniers's avatar Nick Desaulniers Committed by Anna Schumaker

nfs: remove incorrect fallthrough label

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 replaced the comment with a break
statement.

If we consider implicit fallthrough to be a design mistake of C, then
all case statements should be terminated with one of the following
statements:
* break
* continue
* return
* fallthrough
* goto
* (call of function with __attribute__(__noreturn__))

Fixes: 2a1390c95a69 ("nfs: Convert to use the preferred fallthrough macro")
Link: https://bugs.llvm.org/show_bug.cgi?id=47539Acked-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Suggested-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 76bd5c01
...@@ -889,7 +889,7 @@ static struct nfs_server *nfs_try_mount_request(struct fs_context *fc) ...@@ -889,7 +889,7 @@ static struct nfs_server *nfs_try_mount_request(struct fs_context *fc)
default: default:
if (rpcauth_get_gssinfo(flavor, &info) != 0) if (rpcauth_get_gssinfo(flavor, &info) != 0)
continue; continue;
fallthrough; break;
} }
dfprintk(MOUNT, "NFS: attempting to use auth flavor %u\n", flavor); dfprintk(MOUNT, "NFS: attempting to use auth flavor %u\n", flavor);
ctx->selected_flavor = flavor; ctx->selected_flavor = flavor;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment