All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>, qemu-devel@nongnu.org
Cc: marcel.a@redhat.com, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH v5 1/5] pc: acpi-build: cleanup AcpiPmInfo initialization
Date: Wed, 21 Jan 2015 11:11:08 +0200	[thread overview]
Message-ID: <54BF6D2C.7060005@redhat.com> (raw)
In-Reply-To: <1421831353-5507-2-git-send-email-imammedo@redhat.com>

On 01/21/2015 11:09 AM, 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>
> ---
>   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 77a124e..4c0536f 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);
>
>

Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>

  reply	other threads:[~2015-01-21  9:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21  9:09 [Qemu-devel] [PATCH v5 0/5] pc: acpi: various fixes and cleanups Igor Mammedov
2015-01-21  9:09 ` [Qemu-devel] [PATCH v5 1/5] pc: acpi-build: cleanup AcpiPmInfo initialization Igor Mammedov
2015-01-21  9:11   ` Marcel Apfelbaum [this message]
2015-01-21  9:09 ` [Qemu-devel] [PATCH v5 2/5] acpi: move generic aml building helpers into dedictated file Igor Mammedov
2015-01-21  9:13   ` Marcel Apfelbaum
2015-01-27 12:23   ` Michael S. Tsirkin
2015-01-28 12:34     ` Igor Mammedov
2015-01-21  9:09 ` [Qemu-devel] [PATCH v5 3/5] acpi: add build_append_namestring() helper Igor Mammedov
2015-01-21  9:22   ` Marcel Apfelbaum
2015-01-21  9:09 ` [Qemu-devel] [PATCH v5 4/5] acpi: drop min-bytes in build_package() Igor Mammedov
2015-01-21  9:25   ` Marcel Apfelbaum
2015-01-21  9:09 ` [Qemu-devel] [PATCH v5 5/5] pc: acpi-build: simplify PCI bus tree generation Igor Mammedov
2015-01-21  9:51   ` Marcel Apfelbaum

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=54BF6D2C.7060005@redhat.com \
    --to=marcel@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=mst@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.