From patchwork Sat Oct 4 20:24:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 396561 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3FBFD1401E7 for ; Sun, 5 Oct 2014 07:25:58 +1100 (EST) Received: from localhost ([::1]:45162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaVtr-0006kz-HQ for incoming@patchwork.ozlabs.org; Sat, 04 Oct 2014 16:25:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaVt4-0005K0-92 for qemu-devel@nongnu.org; Sat, 04 Oct 2014 16:25:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XaVsy-0004J2-11 for qemu-devel@nongnu.org; Sat, 04 Oct 2014 16:25:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XaVsx-0004Is-Qt for qemu-devel@nongnu.org; Sat, 04 Oct 2014 16:24:59 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s94KOvmw010943 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 4 Oct 2014 16:24:57 -0400 Received: from localhost (ovpn-112-23.ams2.redhat.com [10.36.112.23]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s94KOu8G023499; Sat, 4 Oct 2014 16:24:57 -0400 From: Stefan Hajnoczi To: Date: Sat, 4 Oct 2014 21:24:29 +0100 Message-Id: <1412454289-1789-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1412454289-1789-1-git-send-email-stefanha@redhat.com> References: <1412454289-1789-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell Subject: [Qemu-devel] [PULL 03/23] block: Drop superfluous conditionals around qemu_opts_del() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Markus Armbruster Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-id: 1411999675-14533-1-git-send-email-armbru@redhat.com Signed-off-by: Stefan Hajnoczi --- 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;