From: "Michael S. Tsirkin" <mst@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v6 1/5] pc: acpi-build: cleanup AcpiPmInfo initialization
Date: Wed, 28 Jan 2015 17:22:49 +0200 [thread overview]
Message-ID: <20150128152249.GF32474@redhat.com> (raw)
In-Reply-To: <1422455690-13950-2-git-send-email-imammedo@redhat.com>
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 <imammedo@redhat.com>
> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>
> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
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
next prev parent reply other threads:[~2015-01-28 15:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-28 14:34 [Qemu-devel] [PATCH v6 0/5] pc: acpi: various fixes and cleanups Igor Mammedov
2015-01-28 14:34 ` [Qemu-devel] [PATCH v6 1/5] pc: acpi-build: cleanup AcpiPmInfo initialization Igor Mammedov
2015-01-28 15:22 ` Michael S. Tsirkin [this message]
2015-01-28 14:34 ` [Qemu-devel] [PATCH v6 2/5] acpi: move generic aml building helpers into dedictated file Igor Mammedov
2015-01-28 14:34 ` [Qemu-devel] [PATCH v6 3/5] acpi: add build_append_namestring() helper Igor Mammedov
2015-01-28 15:16 ` Michael S. Tsirkin
2015-01-28 15:44 ` Igor Mammedov
2015-01-28 16:07 ` Michael S. Tsirkin
2015-01-30 11:46 ` Igor Mammedov
2015-01-31 17:05 ` Michael S. Tsirkin
2015-02-02 8:31 ` Igor Mammedov
2015-01-28 14:34 ` [Qemu-devel] [PATCH v6 4/5] acpi: drop min-bytes in build_package() Igor Mammedov
2015-01-28 14:34 ` [Qemu-devel] [PATCH v6 5/5] pc: acpi-build: simplify PCI bus tree generation Igor Mammedov
2015-01-28 15:21 ` Michael S. Tsirkin
2015-01-28 15:53 ` Igor Mammedov
2015-01-28 16:02 ` Michael S. Tsirkin
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=20150128152249.GF32474@redhat.com \
--to=mst@redhat.com \
--cc=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.