summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2015-04-23 17:17:40 +0100
committerBen Hutchings <ben@decadent.org.uk>2017-04-04 22:21:55 +0100
commit1fcb247a6bca1e37f25b8bcba7c8c409e0eb11d0 (patch)
tree12f4de7bdc4b8449bb59d7f6a1b76c16737d39f2 /fs
parentfa5c761a1d5ec1614268cf74bbe8fa5b63b280de (diff)
downloadlinux-stable-1fcb247a6bca1e37f25b8bcba7c8c409e0eb11d0.tar.gz
linux-stable-1fcb247a6bca1e37f25b8bcba7c8c409e0eb11d0.tar.bz2
linux-stable-1fcb247a6bca1e37f25b8bcba7c8c409e0eb11d0.zip
fs/nfs: fix new compiler warning about boolean in switch
commit c7757074839f2cd440521482d76ea180d0d4bdac upstream. The brand new GCC 5.1.0 warns by default on using a boolean in the switch condition. This results in the following warning: fs/nfs/nfs4proc.c: In function 'nfs4_proc_get_rootfh': fs/nfs/nfs4proc.c:3100:10: warning: switch condition has boolean value [-Wswitch-bool] switch (auth_probe) { ^ This code was obviously using switch to make use of the fall-through semantics (without the usual comment, though). Rewrite that code using if statements to avoid the warning and make the code a bit more readable on the way. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4proc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 1522ec81c26f..e07fbf97a93b 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3000,16 +3000,13 @@ int nfs4_proc_get_rootfh(struct nfs_server *server, struct nfs_fh *fhandle,
struct nfs_fsinfo *info,
bool auth_probe)
{
- int status;
+ int status = 0;
- switch (auth_probe) {
- case false:
+ if (!auth_probe)
status = nfs4_lookup_root(server, fhandle, info);
- if (status != -NFS4ERR_WRONGSEC)
- break;
- default:
+
+ if (auth_probe || status == NFS4ERR_WRONGSEC)
status = nfs4_do_find_root_sec(server, fhandle, info);
- }
if (status == 0)
status = nfs4_server_capabilities(server, fhandle);