From patchwork Fri Dec 19 11:46:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 422856 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 0DCA61400A0 for ; Fri, 19 Dec 2014 22:48:49 +1100 (AEDT) Received: from localhost ([::1]:57937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1w35-0004Kf-8S for incoming@patchwork.ozlabs.org; Fri, 19 Dec 2014 06:48:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1w2N-00037C-PO for qemu-devel@nongnu.org; Fri, 19 Dec 2014 06:48:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1w2E-00058t-UR for qemu-devel@nongnu.org; Fri, 19 Dec 2014 06:48:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1w2E-00058b-M0 for qemu-devel@nongnu.org; Fri, 19 Dec 2014 06:47:54 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBJBlKnr001011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 19 Dec 2014 06:47:20 -0500 Received: from dell-pet610-01.lab.eng.brq.redhat.com (dell-pet610-01.lab.eng.brq.redhat.com [10.34.42.20]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBJBlFrB000509; Fri, 19 Dec 2014 06:47:19 -0500 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Fri, 19 Dec 2014 11:46:59 +0000 Message-Id: <1418989624-12049-4-git-send-email-imammedo@redhat.com> In-Reply-To: <1418989624-12049-1-git-send-email-imammedo@redhat.com> References: <1418989624-12049-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: mst@redhat.com, claudio.fontana@huawei.com, marcel.a@redhat.com Subject: [Qemu-devel] [PATCH v3 3/8] pc: acpi-build: cleanup AcpiPmInfo initialization 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 zero initialize AcpiPmInfo struct to reduce code bloat a little bit. Signed-off-by: Igor Mammedov Reviewed-by: Claudio Fontana --- hw/i386/acpi-build.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index c151fde..0351363 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -169,6 +169,8 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) Object *obj = NULL; QObject *o; + memset(pm, 0, sizeof(*pm)); + if (piix) { obj = piix; } @@ -181,22 +183,16 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) o = object_property_get_qobject(obj, ACPI_PM_PROP_S3_DISABLED, NULL); if (o) { pm->s3_disabled = qint_get_int(qobject_to_qint(o)); - } else { - pm->s3_disabled = false; } qobject_decref(o); o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_DISABLED, NULL); if (o) { pm->s4_disabled = qint_get_int(qobject_to_qint(o)); - } else { - pm->s4_disabled = false; } qobject_decref(o); o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_VAL, NULL); if (o) { pm->s4_val = qint_get_int(qobject_to_qint(o)); - } else { - pm->s4_val = false; } qobject_decref(o);