volser: Remove redundant success flag
authorSimon Wilkinson <sxw@your-file-system.com>
Sun, 24 Feb 2013 13:05:13 +0000 (13:05 +0000)
committerDerrick Brashear <shadow@your-file-system.com>
Mon, 25 Feb 2013 18:42:45 +0000 (10:42 -0800)
In UV_RestoreVolume2, there is a success flag whose only use is ...

   success = 0
   [ ... ]
   success = 1
   if (success) {
      [ ... ]
   }

It's pointless, so just remove it, and one clang warning

Caught by clang-analyzer

Change-Id: I7d57531c4dfb8955b813d534ad3b72b182fdbc76
Reviewed-on: http://gerrit.openafs.org/9255
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/volser/vsprocs.c

index 333bbfa..a5147b0 100644 (file)
@@ -4543,7 +4543,6 @@ UV_RestoreVolume2(afs_uint32 toserver, afs_int32 topart, afs_uint32 tovolid,
     char tovolreal[VOLSER_OLDMAXVOLNAME];
     afs_uint32 pvolid;
     afs_int32 temptid, pparentid;
-    int success;
     struct nvldbentry entry, storeEntry;
     afs_int32 error;
     int islocked;
@@ -4557,7 +4556,6 @@ UV_RestoreVolume2(afs_uint32 toserver, afs_int32 topart, afs_uint32 tovolid,
 
     memset(&cookie, 0, sizeof(cookie));
     islocked = 0;
-    success = 0;
     error = 0;
     reuseID = 1;
     tocall = (struct rx_call *)0;
@@ -4757,10 +4755,9 @@ UV_RestoreVolume2(afs_uint32 toserver, afs_int32 topart, afs_uint32 tovolid,
        goto refail;
     }
 
-    success = 1;
     fprintf(STDOUT, " done\n");
     fflush(STDOUT);
-    if (success && (!reuseID || (flags & RV_FULLRST))) {
+    if (!reuseID || (flags & RV_FULLRST)) {
        /* Volume was restored on the file server, update the
         * VLDB to reflect the change.
         */