From 0374cbd2f1b5bc68816c811bdaf266d98b21ecfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sun, 11 Oct 2020 17:18:59 +0200 Subject: hw/pci-host: Use the PCI_BUILD_BDF() macro from 'hw/pci/pci.h' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é Acked-by: David Gibson Acked-by: Michael S. Tsirkin Message-Id: <20201012124506.3406909-3-philmd@redhat.com> --- hw/pci-host/pnv_phb4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/pci-host/pnv_phb4.c') diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 03daf40a23..6328e985f8 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 ? ... */ -- cgit v1.2.3