From b0e5196a52248d7e4eef709481c1c530c1bca6df Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 24 Apr 2019 14:19:58 +1000 Subject: pci: Simplify pci_bus_is_root() pci_bus_is_root() currently relies on a method in the PCIBusClass. But it's always known if a PCI bus is a root bus when we create it, so using a dynamic method is overkill. This replaces it with an IS_ROOT bit in a new flags field, which is set on root buses and otherwise clear. As a bonus this removes the special is_root logic from pci_expander_bridge, since it already creates its bus as a root bus. Signed-off-by: David Gibson Reviewed-by: Marcel Apfelbaum Reviewed-by: Peter Xu Reviewed-by: Greg Kurz Message-Id: <20190424041959.4087-3-david@gibson.dropbear.id.au> --- include/hw/pci/pci.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/hw/pci/pci.h') diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index fdd4c43d3a..edf44de21d 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -395,7 +395,6 @@ typedef PCIINTxRoute (*pci_route_irq_fn)(void *opaque, int pin); #define TYPE_PCIE_BUS "PCIE" bool pci_bus_is_express(PCIBus *bus); -bool pci_bus_is_root(PCIBus *bus); bool pci_bus_allows_extended_config_space(PCIBus *bus); void pci_root_bus_new_inplace(PCIBus *bus, size_t bus_size, DeviceState *parent, -- cgit 1.4.1