Skip to content

Commit 75bfb70

Browse files
ColinIanKingchucklever
authored andcommitted
nfsd: remove redundant assignments to variable len
There are a few assignments to variable len where the value is not being read and so the assignments are redundant and can be removed. In one case, the variable len can be removed completely. Cleans up 4 clang scan warnings of the form: fs/nfsd/export.c:100:7: warning: Although the value stored to 'len' is used in the enclosing expression, the value is never actually read from 'len' [deadcode.DeadStores] Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 88770b8 commit 75bfb70

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

fs/nfsd/export.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
9797
goto out;
9898

9999
err = -EINVAL;
100-
if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
100+
if (qword_get(&mesg, buf, PAGE_SIZE) <= 0)
101101
goto out;
102102

103103
err = -ENOENT;
@@ -107,7 +107,7 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
107107
dprintk("found domain %s\n", buf);
108108

109109
err = -EINVAL;
110-
if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
110+
if (qword_get(&mesg, buf, PAGE_SIZE) <= 0)
111111
goto out;
112112
fsidtype = simple_strtoul(buf, &ep, 10);
113113
if (*ep)
@@ -593,7 +593,6 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
593593
{
594594
/* client path expiry [flags anonuid anongid fsid] */
595595
char *buf;
596-
int len;
597596
int err;
598597
struct auth_domain *dom = NULL;
599598
struct svc_export exp = {}, *expp;
@@ -609,8 +608,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
609608

610609
/* client */
611610
err = -EINVAL;
612-
len = qword_get(&mesg, buf, PAGE_SIZE);
613-
if (len <= 0)
611+
if (qword_get(&mesg, buf, PAGE_SIZE) <= 0)
614612
goto out;
615613

616614
err = -ENOENT;
@@ -620,7 +618,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
620618

621619
/* path */
622620
err = -EINVAL;
623-
if ((len = qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
621+
if (qword_get(&mesg, buf, PAGE_SIZE) <= 0)
624622
goto out1;
625623

626624
err = kern_path(buf, 0, &exp.ex_path);
@@ -665,7 +663,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
665663
goto out3;
666664
exp.ex_fsid = an_int;
667665

668-
while ((len = qword_get(&mesg, buf, PAGE_SIZE)) > 0) {
666+
while (qword_get(&mesg, buf, PAGE_SIZE) > 0) {
669667
if (strcmp(buf, "fsloc") == 0)
670668
err = fsloc_parse(&mesg, buf, &exp.ex_fslocs);
671669
else if (strcmp(buf, "uuid") == 0)

0 commit comments

Comments
 (0)