aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2015-04-23 12:17:40 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-04-23 15:16:16 -0400
commitc7757074839f2cd440521482d76ea180d0d4bdac (patch)
treeb95d52b82aa3aaa30fd48b3d464d5c872ed10991 /fs/nfs
parentc456aacf3c27b9a3013d4524fdc4bd0bb61fb884 (diff)
fs/nfs: fix new compiler warning about boolean in switch
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>
Diffstat (limited to 'fs/nfs')
-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 60396330044f..addf17d25bea 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3096,16 +3096,13 @@ int nfs4_proc_get_rootfh(struct nfs_server *server, struct nfs_fh *fhandle,
3096 struct nfs_fsinfo *info, 3096 struct nfs_fsinfo *info,
3097 bool auth_probe) 3097 bool auth_probe)
3098{ 3098{
3099 int status; 3099 int status = 0;
3100 3100
3101 switch (auth_probe) { 3101 if (!auth_probe)
3102 case false:
3103 status = nfs4_lookup_root(server, fhandle, info); 3102 status = nfs4_lookup_root(server, fhandle, info);
3104 if (status != -NFS4ERR_WRONGSEC) 3103
3105 break; 3104 if (auth_probe || status == NFS4ERR_WRONGSEC)
3106 default:
3107 status = nfs4_do_find_root_sec(server, fhandle, info); 3105 status = nfs4_do_find_root_sec(server, fhandle, info);
3108 }
3109 3106
3110 if (status == 0) 3107 if (status == 0)
3111 status = nfs4_server_capabilities(server, fhandle); 3108 status = nfs4_server_capabilities(server, fhandle);