aboutsummaryrefslogtreecommitdiff
path: root/hw/acpi
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2022-11-29 11:13:41 +0100
committerMichael S. Tsirkin <mst@redhat.com>2022-12-21 07:32:24 -0500
commitad4942746cb428f649f854e1d13622a745f603a5 (patch)
tree91c81e1c931d68186f6152c9782e445417286195 /hw/acpi
parentb1fbf24259188717e8b52eecaf8ca66da3e6ac58 (diff)
downloadqemu-ad4942746cb428f649f854e1d13622a745f603a5.zip
qemu-ad4942746cb428f649f854e1d13622a745f603a5.tar.gz
qemu-ad4942746cb428f649f854e1d13622a745f603a5.tar.bz2
pci: drop redundant PCIDeviceClass::is_bridge field
and use cast to TYPE_PCI_BRIDGE instead. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20221129101341.185621-3-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org>
Diffstat (limited to 'hw/acpi')
-rw-r--r--hw/acpi/pcihp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index 84d75e6..99a898d 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -186,7 +186,6 @@ static PCIBus *acpi_pcihp_find_hotplug_bus(AcpiPciHpState *s, int bsel)
static bool acpi_pcihp_pc_no_hotplug(AcpiPciHpState *s, PCIDevice *dev)
{
- PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
DeviceClass *dc = DEVICE_GET_CLASS(dev);
/*
* ACPI doesn't allow hotplug of bridge devices. Don't allow
@@ -196,7 +195,7 @@ static bool acpi_pcihp_pc_no_hotplug(AcpiPciHpState *s, PCIDevice *dev)
* Don't allow hot-unplug of SR-IOV Virtual Functions, as they
* will be removed implicitly, when Physical Function is unplugged.
*/
- return (pc->is_bridge && !dev->qdev.hotplugged) || !dc->hotpluggable ||
+ return (IS_PCI_BRIDGE(dev) && !dev->qdev.hotplugged) || !dc->hotpluggable ||
pci_is_vf(dev);
}