Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
hw/pci/pci: Simplify pci_bar_address() using MACHINE_GET_CLASS() macro
Remove unnecessary intermediate variables.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
philmd authored and Michael Tokarev committed Jun 9, 2023
1 parent a5c80ab commit 271233f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions hw/pci/pci.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 271233f

Please sign in to comment.