qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC v2 4/6] pci: Manually simplify QOM casts at pci_host_b


From: Eduardo Habkost
Subject: [Qemu-devel] [RFC v2 4/6] pci: Manually simplify QOM casts at pci_host_bus_init*() calls
Date: Tue, 18 Apr 2017 19:17:22 -0300

Those redundant casts were not detected by the Coccinelle patch because
there are multiple variables and casts involved. Fix them manually.

Cc: "Michael S. Tsirkin" <address@hidden>
Cc: Alexander Graf <address@hidden>
Cc: David Gibson <address@hidden>
Cc: Aurelien Jarno <address@hidden>
Cc: address@hidden
Signed-off-by: Eduardo Habkost <address@hidden>
---
 hw/pci-host/q35.c      | 2 +-
 hw/pci-host/uninorth.c | 2 +-
 hw/ppc/spapr_pci.c     | 2 +-
 hw/sh4/sh_pci.c        | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 947dc3f124..4258076979 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -49,7 +49,7 @@ static void q35_host_realize(DeviceState *dev, Error **errp)
     sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem);
     sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, 4);
 
-    pci->bus = pci_host_bus_init(PCI_HOST_BRIDGE(s), "pcie.0",
+    pci->bus = pci_host_bus_init(pci, "pcie.0",
                                  s->mch.pci_address_space,
                                  s->mch.address_space_io, 0, TYPE_PCIE_BUS);
     PC_MACHINE(qdev_get_machine())->bus = pci->bus;
diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
index 079faad6ff..d9fb5fdc93 100644
--- a/hw/pci-host/uninorth.c
+++ b/hw/pci-host/uninorth.c
@@ -233,7 +233,7 @@ PCIBus *pci_pmac_init(qemu_irq *pic,
     memory_region_add_subregion(address_space_mem, 0x80000000ULL,
                                 &d->pci_hole);
 
-    h->bus = pci_host_bus_init_irqs(PCI_HOST_BRIDGE(dev), NULL,
+    h->bus = pci_host_bus_init_irqs(h, NULL,
                                     pci_unin_set_irq, pci_unin_map_irq, pic,
                                     &d->pci_mmio, address_space_io,
                                     PCI_DEVFN(11, 0), 4, TYPE_PCI_BUS);
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 7f29cc77b0..ce132c5eea 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1697,7 +1697,7 @@ static void spapr_phb_realize(DeviceState *dev, Error 
**errp)
     memory_region_add_subregion(get_system_memory(), sphb->io_win_addr,
                                 &sphb->iowindow);
 
-    bus = pci_host_bus_init_irqs(PCI_HOST_BRIDGE(dev), NULL,
+    bus = pci_host_bus_init_irqs(phb, NULL,
                                  pci_spapr_set_irq, pci_spapr_map_irq, sphb,
                                  &sphb->memspace, &sphb->iospace,
                                  PCI_DEVFN(0, 0), PCI_NUM_PINS, TYPE_PCI_BUS);
diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c
index f589b1628e..8be2e830e9 100644
--- a/hw/sh4/sh_pci.c
+++ b/hw/sh4/sh_pci.c
@@ -131,7 +131,7 @@ static int sh_pci_device_init(SysBusDevice *dev)
     for (i = 0; i < 4; i++) {
         sysbus_init_irq(dev, &s->irq[i]);
     }
-    phb->bus = pci_host_bus_init_irqs(PCI_HOST_BRIDGE(dev), "pci",
+    phb->bus = pci_host_bus_init_irqs(phb, "pci",
                                       sh_pci_set_irq, sh_pci_map_irq, s->irq,
                                       get_system_memory(), get_system_io(),
                                       PCI_DEVFN(0, 0), 4, TYPE_PCI_BUS);
-- 
2.11.0.259.g40922b1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]