hw/pci-host/uninorth: Use the PCI_FUNC() macro from 'hw/pci/pci.h'
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sun, 11 Oct 2020 15:22:04 +0000 (17:22 +0200)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Mon, 4 Jan 2021 22:24:44 +0000 (23:24 +0100)
We already have a generic PCI_FUNC() macro in "hw/pci/pci.h" to
extract the PCI function identifier, use it.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20201012124506.3406909-4-philmd@redhat.com>

hw/pci-host/uninorth.c

index 0c0a9ecee145c5ea6f0dddd1d0cd4eec8aefb779..f0a4d8c71786faaef9831008d63bd5d204aeb9ea 100644 (file)
@@ -63,7 +63,7 @@ static uint32_t unin_get_config_reg(uint32_t reg, uint32_t addr)
         if (slot == 32) {
             slot = -1; /* XXX: should this be 0? */
         }
-        func = (reg >> 8) & 7;
+        func = PCI_FUNC(reg >> 8);
 
         /* ... and then convert them to x86 format */
         /* config pointer */