aboutsummaryrefslogtreecommitdiff
path: root/hw/pci-host
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-10-11 17:04:23 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-01-04 23:24:44 +0100
commit8d40def66d744a964c2675a19c11f644d288dd4f (patch)
tree960390db0ec52c6ce7fe109bfe70fdb9ac4e346e /hw/pci-host
parentd08b9c1b75c60c66ea65212a9dac90f58542e45e (diff)
downloadqemu-8d40def66d744a964c2675a19c11f644d288dd4f.zip
qemu-8d40def66d744a964c2675a19c11f644d288dd4f.tar.gz
qemu-8d40def66d744a964c2675a19c11f644d288dd4f.tar.bz2
hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h'
We already have a generic PCI_SLOT() macro in "hw/pci/pci.h" to extract the PCI slot identifier, use it. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Paul Durrant <paul@xen.org> Acked-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20201012124506.3406909-5-philmd@redhat.com>
Diffstat (limited to 'hw/pci-host')
-rw-r--r--hw/pci-host/bonito.c2
-rw-r--r--hw/pci-host/ppce500.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index b052956..ee8b193 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -570,7 +570,7 @@ static int pci_bonito_map_irq(PCIDevice *pci_dev, int irq_num)
{
int slot;
- slot = (pci_dev->devfn >> 3);
+ slot = PCI_SLOT(pci_dev->devfn);
switch (slot) {
case 5: /* FULOONG2E_VIA_SLOT, SouthBridge, IDE, USB, ACPI, AC97, MC97 */
diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
index 9517aab..5ad1424 100644
--- a/hw/pci-host/ppce500.c
+++ b/hw/pci-host/ppce500.c
@@ -342,7 +342,7 @@ static const MemoryRegionOps e500_pci_reg_ops = {
static int mpc85xx_pci_map_irq(PCIDevice *pci_dev, int pin)
{
- int devno = pci_dev->devfn >> 3;
+ int devno = PCI_SLOT(pci_dev->devfn);
int ret;
ret = ppce500_pci_map_irq_slot(devno, pin);