From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGUSF-00054I-DK for qemu-devel@nongnu.org; Wed, 28 Jan 2015 10:22:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGUSC-0000fj-0E for qemu-devel@nongnu.org; Wed, 28 Jan 2015 10:22:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35803) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGUSB-0000fb-Nt for qemu-devel@nongnu.org; Wed, 28 Jan 2015 10:22:51 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0SFMpAS009279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 28 Jan 2015 10:22:51 -0500 Date: Wed, 28 Jan 2015 17:22:49 +0200 From: "Michael S. Tsirkin" Message-ID: <20150128152249.GF32474@redhat.com> References: <1422455690-13950-1-git-send-email-imammedo@redhat.com> <1422455690-13950-2-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1422455690-13950-2-git-send-email-imammedo@redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 1/5] pc: acpi-build: cleanup AcpiPmInfo initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: qemu-devel@nongnu.org On Wed, Jan 28, 2015 at 02:34:46PM +0000, Igor Mammedov wrote: > zero initialize AcpiPmInfo struct to reduce code bloat > a little bit. > > Signed-off-by: Igor Mammedov > Reviewed-by: Claudio Fontana > Reviewed-by: Marcel Apfelbaum Pls drop this, I prefer consistent initialization. > --- > 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 4944249..6f8d4e3 100644 > --- a/hw/i386/acpi-build.c > +++ b/hw/i386/acpi-build.c > @@ -172,6 +172,8 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) > Object *obj = NULL; > QObject *o; > > + memset(pm, 0, sizeof(*pm)); > + > if (piix) { > obj = piix; > } > @@ -184,22 +186,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); > > -- > 1.8.3.1