aboutsummaryrefslogtreecommitdiff
path: root/hw/pci-host/pnv_phb4.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-10-11 17:18:59 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-01-04 23:24:44 +0100
commit0374cbd2f1b5bc68816c811bdaf266d98b21ecfe (patch)
treed8fe5ddc441c2d55974432a59880e432f88149c7 /hw/pci-host/pnv_phb4.c
parente551455f1e7a3d7eee9e11e2903e4050bc5511ae (diff)
downloadqemu-0374cbd2f1b5bc68816c811bdaf266d98b21ecfe.zip
qemu-0374cbd2f1b5bc68816c811bdaf266d98b21ecfe.tar.gz
qemu-0374cbd2f1b5bc68816c811bdaf266d98b21ecfe.tar.bz2
hw/pci-host: Use the PCI_BUILD_BDF() macro from 'hw/pci/pci.h'
We already have a generic PCI_BUILD_BDF() macro in "hw/pci/pci.h" to pack these values, 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-3-philmd@redhat.com>
Diffstat (limited to 'hw/pci-host/pnv_phb4.c')
-rw-r--r--hw/pci-host/pnv_phb4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
index 03daf40..6328e98 100644
--- a/hw/pci-host/pnv_phb4.c
+++ b/hw/pci-host/pnv_phb4.c
@@ -889,7 +889,7 @@ static bool pnv_phb4_resolve_pe(PnvPhb4DMASpace *ds)
/* Read RTE */
bus_num = pci_bus_num(ds->bus);
addr = rtt & PHB_RTT_BASE_ADDRESS_MASK;
- addr += 2 * ((bus_num << 8) | ds->devfn);
+ addr += 2 * PCI_BUILD_BDF(bus_num, ds->devfn);
if (dma_memory_read(&address_space_memory, addr, &rte, sizeof(rte))) {
phb_error(ds->phb, "Failed to read RTT entry at 0x%"PRIx64, addr);
/* Set error bits ? fence ? ... */