]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: logical: drop useless if
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Mon, 21 Jul 2014 17:08:58 +0000 (21:08 +0400)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Mon, 21 Jul 2014 17:34:14 +0000 (21:34 +0400)
virStorageBackendLogicalCreateVol contains a piece like:

    if (vol->target.path != NULL) {
        /* A target path passed to CreateVol has no meaning */
        VIR_FREE(vol->target.path);
    }

The 'if' is useless here, but 'syntax-check' doesn't catch that
because of the comment, so drop the 'if'.

src/storage/storage_backend_logical.c

index ed62c2f2ff2685f02532e6e592437b3d475aae2b..495998516a6a03475dd52f07bc6224f85042b3e0 100644 (file)
@@ -742,10 +742,8 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn,
 
     vol->type = VIR_STORAGE_VOL_BLOCK;
 
-    if (vol->target.path != NULL) {
-        /* A target path passed to CreateVol has no meaning */
-        VIR_FREE(vol->target.path);
-    }
+    /* A target path passed to CreateVol has no meaning */
+    VIR_FREE(vol->target.path);
 
     if (virAsprintf(&vol->target.path, "%s/%s",
                     pool->def->target.path,