pci: Eliminate redundant PCIDevice::bus pointer
commitfd56e0612b6454a282fa6a953fdb09281a98c589
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 29 Nov 2017 08:46:27 +0000 (29 19:46 +1100)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 5 Dec 2017 17:13:45 +0000 (5 19:13 +0200)
tree28a829abaa964f8ed4834c2ed10441e2878ad2c8
parentcdc57472dcc2ddc440545bde26791a11b42232b6
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 <david@gibson.dropbear.id.au>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
20 files changed:
hw/acpi/pcihp.c
hw/acpi/piix4.c
hw/i386/xen/xen_platform.c
hw/isa/lpc_ich9.c
hw/net/vmxnet3.c
hw/pci-bridge/pci_expander_bridge.c
hw/pci-host/piix.c
hw/pci-host/versatile.c
hw/pci/pci.c
hw/pci/pci_bridge.c
hw/pci/pcie.c
hw/pci/pcie_aer.c
hw/ppc/spapr_pci.c
hw/s390x/s390-pci-bus.c
hw/scsi/vmw_pvscsi.c
hw/usb/hcd-xhci.c
hw/vfio/pci.c
hw/virtio/virtio-pci.c
hw/xen/xen_pt.c
include/hw/pci/pci.h