This variable is used once in an assertion. Remove single declaration and access directly in the assert().
See in "qemu/osdep.h": * [...] disable assertion is not * supported upstream so the risk is all yours. Meanwhile, please * submit patches to remove any side-effects inside an assertion, or * fixing error handling that should use Error instead of assert. Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com> --- hw/pci-bridge/pci_bridge_dev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c index 4a080b7c7bf..10c521085d7 100644 --- a/hw/pci-bridge/pci_bridge_dev.c +++ b/hw/pci-bridge/pci_bridge_dev.c @@ -224,9 +224,7 @@ void pci_bridge_dev_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, void pci_bridge_dev_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { - PCIDevice *pci_hotplug_dev = PCI_DEVICE(hotplug_dev); - - g_assert(shpc_present(pci_hotplug_dev)); + g_assert(shpc_present(PCI_DEVICE(hotplug_dev))); shpc_device_unplug_cb(hotplug_dev, dev, errp); } -- 2.26.2