From fd56e0612b6454a282fa6a953fdb09281a98c589 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 29 Nov 2017 19:46:27 +1100 Subject: pci: Eliminate redundant PCIDevice::bus pointer The bus pointer in PCIDevice is basically redundant with QOM information. It's always initialized to the qdev_get_parent_bus(), the only difference is the type. Therefore this patch eliminates the field, instead creating a pci_get_bus() helper to do the type mangling to derive it conveniently from the QOM Device object underneath. Signed-off-by: David Gibson Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Eduardo Habkost Reviewed-by: Marcel Apfelbaum Reviewed-by: Peter Xu --- hw/pci-host/versatile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/pci-host/versatile.c') diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c index 8803ada..d0b02bd 100644 --- a/hw/pci-host/versatile.c +++ b/hw/pci-host/versatile.c @@ -311,7 +311,7 @@ static const MemoryRegionOps pci_vpb_config_ops = { static int pci_vpb_map_irq(PCIDevice *d, int irq_num) { - PCIVPBState *s = container_of(d->bus, PCIVPBState, pci_bus); + PCIVPBState *s = container_of(pci_get_bus(d), PCIVPBState, pci_bus); if (s->irq_mapping == PCI_VPB_IRQMAP_BROKEN) { /* Legacy broken IRQ mapping for compatibility with old and -- cgit v1.1