From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, stefanha@redhat.com
Subject: [Qemu-devel] [PATCH] block: Drop superfluous conditionals around qemu_opts_del()
Date: Mon, 29 Sep 2014 16:07:55 +0200 [thread overview]
Message-ID: <1411999675-14533-1-git-send-email-armbru@redhat.com> (raw)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
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
next reply other threads:[~2014-09-29 14:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-29 14:07 Markus Armbruster [this message]
2014-09-29 16:20 ` [Qemu-devel] [PATCH] block: Drop superfluous conditionals around qemu_opts_del() Eric Blake
2014-09-30 9:58 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1411999675-14533-1-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).