From: Philippe Mathieu-Daudé Date: Tue, 23 May 2023 06:12:06 +0000 (+0200) Subject: hw/pci/pci: Simplify pci_bar_address() using MACHINE_GET_CLASS() macro X-Git-Tag: v8.1.0-rc0~60^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=271233f21f66c10194a45c1bff1db61fe2694a22;p=thirdparty%2Fqemu.git hw/pci/pci: Simplify pci_bar_address() using MACHINE_GET_CLASS() macro Remove unnecessary intermediate variables. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Michael Tokarev --- diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 9b7b4d7c180..bf38905b7dc 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1446,9 +1446,7 @@ pcibus_t pci_bar_address(PCIDevice *d, { pcibus_t new_addr, last_addr; uint16_t cmd = pci_get_word(d->config + PCI_COMMAND); - Object *machine = qdev_get_machine(); - ObjectClass *oc = object_get_class(machine); - MachineClass *mc = MACHINE_CLASS(oc); + MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); bool allow_0_address = mc->pci_allow_0_address; if (type & PCI_BASE_ADDRESS_SPACE_IO) {