[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/5] hw/pci-host/bonito: Make PCI_ADDR() macro more readable
- To: qemu-devel@xxxxxxxxxx
- From: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
- Date: Mon, 12 Oct 2020 14:45:02 +0200
- Authentication-results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@xxxxxxxxxx
- Cc: Peter Maydell <peter.maydell@xxxxxxxxxx>, qemu-ppc@xxxxxxxxxx, qemu-trivial@xxxxxxxxxx, Paul Durrant <paul@xxxxxxx>, Aurelien Jarno <aurelien@xxxxxxxxxxx>, qemu-arm@xxxxxxxxxx, Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Cédric Le Goater <clg@xxxxxxxx>, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Helge Deller <deller@xxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Richard Henderson <rth@xxxxxxxxxxx>, Aleksandar Markovic <aleksandar.qemu.devel@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Huacai Chen <chenhc@xxxxxxxxxx>
- Delivery-date: Mon, 12 Oct 2020 12:45:27 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
From: Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>
The PCI_ADDR() macro use generic PCI fields shifted by 8-bit.
Rewrite it extracting the shift operation one layer.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>
---
hw/pci-host/bonito.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index a99eced0657..abb3ee86769 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -196,8 +196,8 @@ 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))
+ ((((busno) << 8) & 0xff00) + (((devno) << 3) & 0xf8) + \
+ (((funno) & 0x7) << 8) + (regno))
typedef struct BonitoState BonitoState;
--
2.26.2
|