diff options
author | Ani Sinha <ani@anisinha.ca> | 2021-08-25 08:49:46 +0530 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-09-04 17:34:05 -0400 |
commit | 028f1a88ab1fff40aa134192da609943f7f67a5e (patch) | |
tree | 37540baaacf3c57b040882a6a96241aebddf0f31 /hw/acpi/pcihp.c | |
parent | 6c1ebe75ae7a9f873c40b9582d7f14c6fe4129ea (diff) |
hw/acpi: use existing references to pci device struct within functions
There is no need to use fresh typecasts to get references to pci device structs
when there is an existing reference to pci device struct. Use existing reference.
Minor cleanup.
Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210825031949.919376-3-ani@anisinha.ca>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi/pcihp.c')
-rw-r--r-- | hw/acpi/pcihp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index f4d706e47d..f610a25d2e 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -283,7 +283,7 @@ void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotplug_dev, /* Only hotplugged devices need the hotplug capability. */ if (dev->hotplugged && - acpi_pcihp_get_bsel(pci_get_bus(PCI_DEVICE(dev))) < 0) { + acpi_pcihp_get_bsel(pci_get_bus(pdev)) < 0) { error_setg(errp, "Unsupported bus. Bus doesn't have property '" ACPI_PCIHP_PROP_BSEL "' set"); return; @@ -363,8 +363,8 @@ void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s, { PCIDevice *pdev = PCI_DEVICE(dev); - trace_acpi_pci_unplug(PCI_SLOT(PCI_DEVICE(dev)->devfn), - acpi_pcihp_get_bsel(pci_get_bus(PCI_DEVICE(dev)))); + trace_acpi_pci_unplug(PCI_SLOT(pdev->devfn), + acpi_pcihp_get_bsel(pci_get_bus(pdev))); /* * clean up acpi-index so it could reused by another device |