qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH for-6.2 6/6] Use PCI_HOST_BRIDGE macro
Date: Fri, 6 Aug 2021 13:01:10 +0200	[thread overview]
Message-ID: <20210806130110.73e6f40c@redhat.com> (raw)
In-Reply-To: <20210805193431.307761-7-ehabkost@redhat.com>

On Thu,  5 Aug 2021 15:34:31 -0400
Eduardo Habkost <ehabkost@redhat.com> wrote:

> OBJECT_CHECK(PciHostState, ..., TYPE_PCI_HOST_BRIDGE) is exactly
> what the PCI_HOST_BRIDGE macro does.  We can just use the macro
> instead of using OBJECT_CHECK manually.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Richard Henderson <richard.henderson@linaro.org>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> Cc: qemu-devel@nongnu.org
> ---
>  hw/i386/acpi-build.c | 8 ++------
>  hw/pci-host/i440fx.c | 4 +---
>  2 files changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index a33ac8b91e1..3c6bbb1beb3 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -303,13 +303,9 @@ Object *acpi_get_i386_pci_host(void)
>  {
>      PCIHostState *host;
>  
> -    host = OBJECT_CHECK(PCIHostState,
> -                        object_resolve_path("/machine/i440fx", NULL),
> -                        TYPE_PCI_HOST_BRIDGE);
> +    host = PCI_HOST_BRIDGE(object_resolve_path("/machine/i440fx", NULL));
>      if (!host) {
> -        host = OBJECT_CHECK(PCIHostState,
> -                            object_resolve_path("/machine/q35", NULL),
> -                            TYPE_PCI_HOST_BRIDGE);
> +        host = PCI_HOST_BRIDGE(object_resolve_path("/machine/q35", NULL));
>      }
>      return OBJECT(host);
> diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c
> index 28c9bae8994..cd87e21a9b2 100644
> --- a/hw/pci-host/i440fx.c
> +++ b/hw/pci-host/i440fx.c
> @@ -316,9 +316,7 @@ PCIBus *i440fx_init(const char *host_type, const char *pci_type,
>  
>  PCIBus *find_i440fx(void)
>  {
> -    PCIHostState *s = OBJECT_CHECK(PCIHostState,
> -                                   object_resolve_path("/machine/i440fx", NULL),
> -                                   TYPE_PCI_HOST_BRIDGE);
> +    PCIHostState *s = PCI_HOST_BRIDGE(object_resolve_path("/machine/i440fx", NULL));
>      return s ? s->bus : NULL;
>  }
>  



      reply	other threads:[~2021-08-06 11:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 19:34 [PATCH for-6.2 0/6] qom: Fix broken OBJECT_CHECK usage Eduardo Habkost
2021-08-05 19:34 ` [PATCH for-6.2 1/6] acpi: Delete broken ACPI_GED_X86 macro Eduardo Habkost
2021-08-06 10:42   ` Igor Mammedov
2021-08-09 10:52   ` Gerd Hoffmann
2021-08-05 19:34 ` [PATCH for-6.2 2/6] sbsa_gwdt: Delete broken SBSA_*CLASS macros Eduardo Habkost
2021-08-05 19:34 ` [PATCH for-6.2 3/6] s390-sclp-events-bus: Set instance_size Eduardo Habkost
2021-08-06  4:16   ` Thomas Huth
2021-08-06  6:54   ` David Hildenbrand
2021-08-06 11:44   ` Cornelia Huck
2021-08-05 19:34 ` [PATCH for-6.2 4/6] s390-sclp-events-bus: Use OBJECT_DECLARE_SIMPLE_TYPE Eduardo Habkost
2021-08-06  2:43   ` Eduardo Habkost
2021-08-06  2:46   ` [PATCH for-6.2 v2] " Eduardo Habkost
2021-08-06  4:14     ` Thomas Huth
2021-08-06  6:54     ` David Hildenbrand
2021-08-06 11:45     ` Cornelia Huck
2021-08-05 19:34 ` [PATCH for-6.2 5/6] s390x: event-facility: Use SCLP_EVENT_BUS macro Eduardo Habkost
2021-08-06  4:15   ` Thomas Huth
2021-08-06  6:54     ` David Hildenbrand
2021-08-06 11:47       ` Cornelia Huck
2021-08-05 19:34 ` [PATCH for-6.2 6/6] Use PCI_HOST_BRIDGE macro Eduardo Habkost
2021-08-06 11:01   ` Igor Mammedov [this message]

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=20210806130110.73e6f40c@redhat.com \
    --to=imammedo@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).