[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/35] Use PCI_HOST_BRIDGE macro
From: |
Michael S. Tsirkin |
Subject: |
[PULL 10/35] Use PCI_HOST_BRIDGE macro |
Date: |
Sat, 4 Sep 2021 17:36:23 -0400 |
From: Eduardo Habkost <ehabkost@redhat.com>
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>
Message-Id: <20210805193431.307761-7-ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
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 6c27e12e2a..9a9572cadb 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 28c9bae899..cd87e21a9b 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;
}
--
MST
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, (continued)
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Philippe Mathieu-Daudé, 2021/09/06
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Ani Sinha, 2021/09/06
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Philippe Mathieu-Daudé, 2021/09/06
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Ani Sinha, 2021/09/06
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Ani Sinha, 2021/09/07
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Philippe Mathieu-Daudé, 2021/09/07
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Ani Sinha, 2021/09/07
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Ani Sinha, 2021/09/07
[PULL 07/35] hw/virtio: move vhost_set_backend_type() to vhost.c, Michael S. Tsirkin, 2021/09/04
[PULL 09/35] acpi: Delete broken ACPI_GED_X86 macro, Michael S. Tsirkin, 2021/09/04
[PULL 10/35] Use PCI_HOST_BRIDGE macro,
Michael S. Tsirkin <=
[PULL 11/35] virtio-balloon: don't start free page hinting if postcopy is possible, Michael S. Tsirkin, 2021/09/04
[PULL 12/35] virtio-balloon: free page hinting cleanups, Michael S. Tsirkin, 2021/09/04
[PULL 13/35] virtio-bus: introduce iommu_enabled(), Michael S. Tsirkin, 2021/09/04
[PULL 14/35] virtio-pci: implement iommu_enabled(), Michael S. Tsirkin, 2021/09/04
[PULL 16/35] hw/i386/acpi-build: Get NUMA information from struct NumaState, Michael S. Tsirkin, 2021/09/04
[PULL 17/35] hw/pci: remove all references to find_i440fx function, Michael S. Tsirkin, 2021/09/04
[PULL 20/35] hw/virtio: Document virtio_queue_packed_empty_rcu is called within RCU, Michael S. Tsirkin, 2021/09/04
[PULL 21/35] hw/virtio: Remove NULL check in virtio_free_region_cache(), Michael S. Tsirkin, 2021/09/04
[PULL 19/35] MAINTAINERS: Added myself as a reviewer for acpi/smbios subsystem, Michael S. Tsirkin, 2021/09/04
[PULL 18/35] hw/acpi: use existing references to pci device struct within functions, Michael S. Tsirkin, 2021/09/04