volser: Remove needless initialisation
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 19 Feb 2013 14:59:10 +0000 (14:59 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 22 Feb 2013 06:07:39 +0000 (22:07 -0800)
Remove a number of places where we initialise a variable to NULL
immediately before we assign a real value to it.

Caught by clang-analyzer

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

src/volser/volprocs.c

index 13c2fc2..2fed208 100644 (file)
@@ -721,7 +721,6 @@ VolClone(struct rx_call *acid, afs_int32 atrans, VolumeId purgeId,
            callerAddress(acid, buffer), newName);
     }
     error = 0;
-    originalvp = (Volume *) 0;
     purgevp = (Volume *) 0;
     newvp = (Volume *) 0;
     tt = ttc = (struct volser_trans *)0;
@@ -907,7 +906,6 @@ VolReClone(struct rx_call *acid, afs_int32 atrans, VolumeId cloneId)
     }
     error = 0;
     clonevp = originalvp = (Volume *) 0;
-    tt = (struct volser_trans *)0;
 
     tt = FindTrans(atrans);
     if (!tt)
@@ -1269,9 +1267,6 @@ VolForward(struct rx_call *acid, afs_int32 fromTrans, afs_int32 fromDate,
 
     if (!afsconf_SuperUser(tdir, acid, caller))
        return VOLSERBAD_ACCESS;        /*not a super user */
-    /* initialize things */
-    tcon = (struct rx_connection *)0;
-    tt = (struct volser_trans *)0;
 
     /* find the local transaction */
     tt = FindTrans(fromTrans);
@@ -2975,10 +2970,8 @@ SAFSVolConvertROtoRWvolume(struct rx_call *acid, afs_int32 partId,
        }
     }
 
-    if (ttc) {
+    if (ttc)
         DeleteTrans(ttc, 1);
-        ttc = (struct volser_trans *)0;
-    }
 
     closedir(dirp);
     return ret;