Unix CM: Don't check if var is 0, then zero it
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 14 Feb 2013 20:08:07 +0000 (20:08 +0000)
committerDerrick Brashear <shadow@your-file-system.com>
Thu, 21 Feb 2013 12:46:36 +0000 (04:46 -0800)
There's a couple of places in afs_daemons.c where we do:

    if (code != 0)
        return;
    code = 0;

The final line is obviously redundant, and makes clang sulk at us.
So, remove it.

Caught by clang-analyzer

Change-Id: Ic55edf1b05f3f45eb1f0cecdb3c2318e6f7bd0ec
Reviewed-on: http://gerrit.openafs.org/9154
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/afs/afs_daemons.c

index d301b46..687bf6a 100644 (file)
@@ -573,7 +573,6 @@ BStore(struct brequest *ab)
     AFS_STATCNT(BStore);
     if ((code = afs_InitReq(&treq, ab->cred)))
        return;
-    code = 0;
     tvc = ab->vc;
 #if defined(AFS_SGI_ENV)
     /*
@@ -620,7 +619,6 @@ BPartialStore(struct brequest *ab)
     AFS_STATCNT(BStore);
     if ((code = afs_InitReq(&treq, ab->cred)))
        return;
-    code = 0;
     tvc = ab->vc;
     locked = tvc->lock.excl_locked? 1:0;
     if (!locked)