mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
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 <david@gibson.dropbear.id.au> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <20190424041959.4087-3-david@gibson.dropbear.id.au>
This commit is contained in:
parent
c76efd7225
commit
b0e5196a52
5 changed files with 14 additions and 20 deletions
|
@ -66,11 +66,6 @@ static int pxb_bus_num(PCIBus *bus)
|
|||
return pxb->bus_nr;
|
||||
}
|
||||
|
||||
static bool pxb_is_root(PCIBus *bus)
|
||||
{
|
||||
return true; /* by definition */
|
||||
}
|
||||
|
||||
static uint16_t pxb_bus_numa_node(PCIBus *bus)
|
||||
{
|
||||
PXBDev *pxb = convert_to_pxb(bus->parent_dev);
|
||||
|
@ -83,7 +78,6 @@ static void pxb_bus_class_init(ObjectClass *class, void *data)
|
|||
PCIBusClass *pbc = PCI_BUS_CLASS(class);
|
||||
|
||||
pbc->bus_num = pxb_bus_num;
|
||||
pbc->is_root = pxb_is_root;
|
||||
pbc->numa_node = pxb_bus_numa_node;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue