[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/35] hw/pci-host: Use the PCI_BUILD_BDF() macro from 'hw/pci/pci
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 01/35] hw/pci-host: Use the PCI_BUILD_BDF() macro from 'hw/pci/pci.h' |
Date: |
Sun, 3 Jan 2021 21:49:47 +0100 |
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>
Message-Id: <20201012124506.3406909-3-philmd@redhat.com>
---
hw/pci-host/bonito.c | 3 +--
hw/pci-host/pnv_phb4.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index a99eced0657..b05295639a6 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -196,8 +196,7 @@ FIELD(BONGENCFG, PCIQUEUE, 12, 1)
#define PCI_IDSEL_VIA686B (1 << PCI_IDSEL_VIA686B_BIT)
#define PCI_ADDR(busno , devno , funno , regno) \
- ((((busno) << 16) & 0xff0000) + (((devno) << 11) & 0xf800) + \
- (((funno) << 8) & 0x700) + (regno))
+ ((PCI_BUILD_BDF(busno, PCI_DEVFN(devno , funno)) << 8) + (regno))
typedef struct BonitoState BonitoState;
diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
index 03daf40a237..6328e985f81 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 ? ... */
--
2.26.2
- [PULL 00/35] MIPS patches for 2021-01-03, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 01/35] hw/pci-host: Use the PCI_BUILD_BDF() macro from 'hw/pci/pci.h',
Philippe Mathieu-Daudé <=
- [PULL 02/35] hw/pci-host/uninorth: Use the PCI_FUNC() macro from 'hw/pci/pci.h', Philippe Mathieu-Daudé, 2021/01/03
- [PULL 03/35] hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h', Philippe Mathieu-Daudé, 2021/01/03
- [PULL 04/35] hw: Use the PCI_DEVFN() macro from 'hw/pci/pci.h', Philippe Mathieu-Daudé, 2021/01/03
- [PULL 05/35] hw/pci-host/bonito: Display hexadecimal value with '0x' prefix, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 06/35] hw/pci-host/bonito: Use pci_config_set_interrupt_pin(), Philippe Mathieu-Daudé, 2021/01/03
- [PULL 07/35] vt82c686: Rename AC97/MC97 parts from VT82C686B to VIA, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 08/35] vt82c686: Remove unnecessary _DEVICE suffix from type macros, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 09/35] vt82c686: Rename VT82C686B to VT82C686B_ISA, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 10/35] vt82c686: Remove vt82c686b_[am]c97_init() functions, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 11/35] vt82c686: Split off via-[am]c97 into separate file in hw/audio, Philippe Mathieu-Daudé, 2021/01/03