qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] block: Drop superfluous conditionals around qemu_op


From: Markus Armbruster
Subject: [Qemu-devel] [PATCH] block: Drop superfluous conditionals around qemu_opts_del()
Date: Mon, 29 Sep 2014 16:07:55 +0200

Signed-off-by: Markus Armbruster <address@hidden>
---
 blockdev.c | 4 +---
 qemu-img.c | 4 +---
 qemu-nbd.c | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index ad43648..2f441c5 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -224,9 +224,7 @@ void drive_info_del(DriveInfo *dinfo)
     if (!dinfo) {
         return;
     }
-    if (dinfo->opts) {
-        qemu_opts_del(dinfo->opts);
-    }
+    qemu_opts_del(dinfo->opts);
     g_free(dinfo->id);
     QTAILQ_REMOVE(&drives, dinfo, next);
     g_free(dinfo->serial);
diff --git a/qemu-img.c b/qemu-img.c
index ea4bbae..27b85db 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1736,9 +1736,7 @@ out:
     qemu_opts_del(opts);
     qemu_opts_free(create_opts);
     qemu_vfree(buf);
-    if (sn_opts) {
-        qemu_opts_del(sn_opts);
-    }
+    qemu_opts_del(sn_opts);
     if (out_bs) {
         bdrv_unref(out_bs);
     }
diff --git a/qemu-nbd.c b/qemu-nbd.c
index fa60338..b524b34 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -778,9 +778,7 @@ int main(int argc, char **argv)
         unlink(sockpath);
     }
 
-    if (sn_opts) {
-        qemu_opts_del(sn_opts);
-    }
+    qemu_opts_del(sn_opts);
 
     if (device) {
         void *ret;
-- 
1.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]