hw: Use PCI macros from 'hw/pci/pci.h'
cover hw: Use PCI macros from 'hw/pci/pci.h'
Trivial patches using the generic PCI macros from "hw/pci/pci.h".
Philippe Mathieu-Daudé (5):
hw/pci-host/bonito: Make PCI_ADDR() macro more readable hw/pci-host: Use the PCI_BUILD_BDF() macro from 'hw/pci/pci.h' hw/pci-host/uninorth: Use the PCI_FUNC() macro from 'hw/pci/pci.h'
hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h'
hw: Use the PCI_DEVFN() macro from 'hw/pci/pci.h'
hw/arm/virt.c | 3 ++- hw/hppa/dino.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- hw/isa/piix3.c | 2 +- hw/mips/gt64xxx_pci.c | 2 +- hw/pci-host/bonito.c | 5 ++--- hw/pci-host/pnv_phb4.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/pci-host/uninorth.c | 8 +++----- hw/ppc/ppc4xx_pci.c | 2 +- hw/sh4/sh_pci.c | 2 +- 11 files changed, 15 insertions(+), 17 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/5 hw/pci-host/bonito: Make PCI_ADDR() macro more readable
From: Philippe Mathieu-Daudé <[email protected]>
The PCI_ADDR() macro use generic PCI fields shifted by 8-bit. Rewrite it extracting the shift operation one layer.
--- hw/pci-host/bonito.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/pci-host/bonito.c +2 -2
@@ -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 ;
Signature · 1 line
2.26.2
Re: [PATCH 1/5] hw/pci-host/bonito: Make PCI_ADDR() macro more readable
Quoted 15 lines · Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé <[email protected]>
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é <[email protected]>---
hw/pci-host/bonito.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)hw/pci-host/bonito.c +0
-0
hw/pci-host/bonito.c FIELD(BONGENCFG, PCIQUEUE, 12, 1) · line 200
Quoted 7 lines
hw/pci-host/bonito.c +2
-2@@ -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))
Are you missing a << 8 somewhere before + (regno) or both of these are equally unreadable and I've missed something? This seems to be completely replaced by next patch so what's the point of this change?
Regards,
BALATON Zoltan
Quoted 4 lines
hw/pci-host/bonito.c +0
-0typedef struct BonitoState BonitoState ;
Re: [PATCH 1/5] hw/pci-host/bonito: Make PCI_ADDR() macro more readable
Quoted 18 lines · BALATON Zoltan
Quoted 17 lines · Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé <[email protected]>
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é <[email protected]>---
hw/pci-host/bonito.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)hw/pci-host/bonito.c +0
-0@@ -196,8 +196,8 @@ FIELD(BONGENCFG, PCIQUEUE, 12, 1)#define PCI_IDSEL_VIA686B (1 << PCI_IDSEL_VIA686B_BIT)
Quoted 7 lines
hw/pci-host/bonito.c FIELD(BONGENCFG, PCIQUEUE, 12, 1) · line 200
Quoted 5 lines
hw/pci-host/bonito.c +2
-2#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))Are you missing a << 8 somewhere before + (regno) or both of these are equally unreadable and I've missed something? This seems to be completely replaced by next patch so what's the point of this change?
I might have missed a parenthesis somewhere indeed =)
I'm happy to merge it in the next patch, I thought it would be easier to review but it isn't.
Thanks for reviewing!
Quoted 8 lines
Regards,
BALATON ZoltanQuoted 4 lines
hw/pci-host/bonito.c +0
-0typedef struct BonitoState BonitoState ;
PATCH 2/5 hw/pci-host: Use the PCI_BUILD_BDF() macro from 'hw/pci/pci.h'
In reply to Philippe Mathieu-DaudéFrom: Philippe Mathieu-Daudé <[email protected]>
We already have a generic PCI_BUILD_BDF() macro in "hw/pci/pci.h" to pack these values, use it.
--- hw/pci-host/bonito.c | 3 +-- hw/pci-host/pnv_phb4.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
hw/pci-host/bonito.c +1 -2
@@ -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) << 8) & 0xff00) + (((devno) << 3) & 0xf8) + \ - (((funno) & 0x7) << 8) + (regno)) + ((PCI_BUILD_BDF(busno, PCI_DEVFN(devno , funno)) << 8) + (regno))typedef struct BonitoState BonitoState ;
hw/pci-host/pnv_phb4.c +1 -1
@@ -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 ? ... */
Signature · 1 line
2.26.2
Re: [PATCH 2/5] hw/pci-host: Use the PCI_BUILD_BDF() macro from 'hw/pci/pci.h'
Quoted 6 lines · Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé <[email protected]>
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é <[email protected]>
pnv part
Quoted 32 lines
--- hw/pci-host/bonito.c | 3 +-- hw/pci-host/pnv_phb4.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)hw/pci-host/bonito.c +1
-2@@ -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) << 8) & 0xff00) + (((devno) << 3) & 0xf8) + \ - (((funno) & 0x7) << 8) + (regno)) + ((PCI_BUILD_BDF(busno, PCI_DEVFN(devno , funno)) << 8) + (regno))typedef struct BonitoState BonitoState ;hw/pci-host/pnv_phb4.c +1
-1@@ -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 ? ... */
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
PATCH 3/5 hw/pci-host/uninorth: Use the PCI_FUNC() macro from 'hw/pci/pci.h'
In reply to Philippe Mathieu-DaudéFrom: Philippe Mathieu-Daudé <[email protected]>
We already have a generic PCI_FUNC() macro in "hw/pci/pci.h" to extract the PCI function identifier, use it.
--- hw/pci-host/uninorth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci-host/uninorth.c +1 -1
@@ -65,7 +65,7 @@ static uint32_t unin_get_config_reg(uint32_t reg, uint32_t addr)if (slot ==32 ) { slot =-1 ;/* XXX: should this be 0? */ } - func = (reg >>8 ) &7 ; + func =PCI_FUNC (reg >>8 );/* ... and then convert them to x86 format */ /* config pointer */
Signature · 1 line
2.26.2
Re: [PATCH 3/5] hw/pci-host/uninorth: Use the PCI_FUNC() macro from 'hw/pci/pci.h'
Quoted 6 lines · Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé <[email protected]>
We already have a generic
PCI_FUNC()macro in "hw/pci/pci.h" to extract the PCI function identifier, use it.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 17 lines
--- hw/pci-host/uninorth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/pci-host/uninorth.c +1
-1@@ -65,7 +65,7 @@ static uint32_t unin_get_config_reg(uint32_t reg, uint32_t addr)if (slot ==32 ) { slot =-1 ;/* XXX: should this be 0? */ } - func = (reg >>8 ) &7 ; + func =PCI_FUNC (reg >>8 );/* ... and then convert them to x86 format */ /* config pointer */
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
PATCH 4/5 hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h'
In reply to Philippe Mathieu-DaudéFrom: Philippe Mathieu-Daudé <[email protected]>
We already have a generic PCI_SLOT() macro in "hw/pci/pci.h" to extract the PCI slot identifier, use it.
--- hw/hppa/dino.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- hw/isa/piix3.c | 2 +- hw/mips/gt64xxx_pci.c | 2 +- hw/pci-host/bonito.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/ppc/ppc4xx_pci.c | 2 +- hw/sh4/sh_pci.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
hw/hppa/dino.c +1 -1
@@ -496,7 +496,7 @@ static void dino_set_irq(void *opaque, int irq, int level)static int dino_pci_map_irq (PCIDevice *d,int irq_num) { -int slot = d->devfn >>3 ; +int slot =PCI_SLOT (d->devfn);assert (irq_num >=0 && irq_num <=3 );
hw/i386/xen/xen-hvm.c +1 -1
@@ -140,7 +140,7 @@ typedef struct XenIOState {int xen_pci_slot_get_pirq (PCIDevice *pci_dev,int irq_num) { -return irq_num + ((pci_dev->devfn >>3 ) <<2 ); +return irq_num + (PCI_SLOT (pci_dev->devfn) <<2 ); }void xen_piix3_set_irq (void *opaque,int irq_num,int level)
hw/isa/piix3.c +1 -1
@@ -361,7 +361,7 @@ type_init(piix3_register_types)static int pci_slot_get_pirq (PCIDevice *pci_dev,int pci_intx) {int slot_addend; - slot_addend = (pci_dev->devfn >>3 ) -1 ; + slot_addend =PCI_SLOT (pci_dev->devfn) -1 ;return (pci_intx + slot_addend) &3 ; }
hw/mips/gt64xxx_pci.c +1 -1
@@ -982,7 +982,7 @@ static int gt64120_pci_map_irq(PCIDevice *pci_dev, int irq_num) {int slot; - slot = (pci_dev->devfn >>3 ); + slot =PCI_SLOT (pci_dev->devfn);switch (slot) {/* PIIX4 USB */
hw/pci-host/bonito.c +1 -1
@@ -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 */
hw/pci-host/ppce500.c +1 -1
@@ -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);
hw/ppc/ppc4xx_pci.c +1 -1
@@ -243,7 +243,7 @@ static void ppc4xx_pci_reset(void *opaque)* may need further refactoring for other boards. */ static int ppc4xx_pci_map_irq (PCIDevice *pci_dev,int irq_num) { -int slot = pci_dev->devfn >>3 ; +int slot =PCI_SLOT (pci_dev->devfn);trace_ppc4xx_pci_map_irq (pci_dev->devfn, irq_num, slot);
hw/sh4/sh_pci.c +1 -1
@@ -109,7 +109,7 @@ static const MemoryRegionOps sh_pci_reg_ops = {static int sh_pci_map_irq (PCIDevice *d,int irq_num) { -return (d->devfn >>3 ); +return PCI_SLOT (d->devfn); }static void sh_pci_set_irq (void *opaque,int irq_num,int level)
Signature · 1 line
2.26.2
RE: [PATCH 4/5] hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h'
Quoted 16 lines
-----Original Message-----
From: Philippe Mathieu-Daudé <[email protected]>
Sent: 12 October 2020 13:45
To: [email protected]
Cc: Peter Maydell <[email protected]>; [email protected]; [email protected]; Paul Durrant <[email protected]>; Aurelien Jarno <[email protected]>; [email protected]; Philippe Mathieu- Daudé <[email protected]>; Michael S. Tsirkin <[email protected]>; Eduardo Habkost <[email protected]>; Jiaxun Yang <[email protected]>; Yoshinori Sato <[email protected]>; Cédric Le Goater <[email protected]>; David Gibson <[email protected]>; Stefano Stabellini <[email protected]>; Helge Deller <[email protected]>; Anthony Perard <[email protected]>; Richard Henderson <[email protected]>; Aleksandar Markovic <[email protected]>; xen- [email protected]; Aleksandar Rikalo <[email protected]>; Marcel Apfelbaum <[email protected]>; Mark Cave-Ayland <[email protected]>; Paolo Bonzini <[email protected]>; Huacai Chen <[email protected]>
Subject: [PATCH 4/5] hw: Use thePCI_SLOT()macro from 'hw/pci/pci.h'
Quoted 6 lines
From: Philippe Mathieu-Daudé <[email protected]>
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é <[email protected]>
xen-hvm change...
Re: [PATCH 4/5] hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h'
In reply to Philippe Mathieu-DaudéQuoted 6 lines · Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé <[email protected]>
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é <[email protected]>
ppc parts
Quoted 115 lines
--- hw/hppa/dino.c | 2 +- hw/i386/xen/xen-hvm.c | 2 +- hw/isa/piix3.c | 2 +- hw/mips/gt64xxx_pci.c | 2 +- hw/pci-host/bonito.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/ppc/ppc4xx_pci.c | 2 +- hw/sh4/sh_pci.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)hw/hppa/dino.c +1
-1@@ -496,7 +496,7 @@ static void dino_set_irq(void *opaque, int irq, int level)static int dino_pci_map_irq (PCIDevice *d,int irq_num) { -int slot = d->devfn >>3 ; +int slot =PCI_SLOT (d->devfn);assert (irq_num >=0 && irq_num <=3 );hw/i386/xen/xen-hvm.c +1
-1@@ -140,7 +140,7 @@ typedef struct XenIOState {int xen_pci_slot_get_pirq (PCIDevice *pci_dev,int irq_num) { -return irq_num + ((pci_dev->devfn >>3 ) <<2 ); +return irq_num + (PCI_SLOT (pci_dev->devfn) <<2 ); }void xen_piix3_set_irq (void *opaque,int irq_num,int level)hw/isa/piix3.c +1
-1@@ -361,7 +361,7 @@ type_init(piix3_register_types)static int pci_slot_get_pirq (PCIDevice *pci_dev,int pci_intx) {int slot_addend; - slot_addend = (pci_dev->devfn >>3 ) -1 ; + slot_addend =PCI_SLOT (pci_dev->devfn) -1 ;return (pci_intx + slot_addend) &3 ; }hw/mips/gt64xxx_pci.c +1
-1@@ -982,7 +982,7 @@ static int gt64120_pci_map_irq(PCIDevice *pci_dev, int irq_num) {int slot; - slot = (pci_dev->devfn >>3 ); + slot =PCI_SLOT (pci_dev->devfn);switch (slot) {/* PIIX4 USB */ hw/pci-host/bonito.c +1
-1@@ -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 */ hw/pci-host/ppce500.c +1
-1@@ -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);hw/ppc/ppc4xx_pci.c +1
-1@@ -243,7 +243,7 @@ static void ppc4xx_pci_reset(void *opaque)* may need further refactoring for other boards. */ static int ppc4xx_pci_map_irq (PCIDevice *pci_dev,int irq_num) { -int slot = pci_dev->devfn >>3 ; +int slot =PCI_SLOT (pci_dev->devfn);trace_ppc4xx_pci_map_irq (pci_dev->devfn, irq_num, slot);hw/sh4/sh_pci.c +1
-1@@ -109,7 +109,7 @@ static const MemoryRegionOps sh_pci_reg_ops = {static int sh_pci_map_irq (PCIDevice *d,int irq_num) { -return (d->devfn >>3 ); +return PCI_SLOT (d->devfn); }static void sh_pci_set_irq (void *opaque,int irq_num,int level)
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
PATCH 5/5 hw: Use the PCI_DEVFN() macro from 'hw/pci/pci.h'
In reply to Philippe Mathieu-DaudéFrom: Philippe Mathieu-Daudé <[email protected]>
We already have a generic PCI_DEVFN() macro in "hw/pci/pci.h" to pack the PCI slot/function identifiers, use it.
--- hw/arm/virt.c | 3 ++- hw/pci-host/uninorth.c | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-)
hw/arm/virt.c +2 -1
@@ -1144,7 +1144,8 @@ static void create_pcie_irq_map(const VirtMachineState *vms, full_irq_map, sizeof(full_irq_map));qemu_fdt_setprop_cells (vms->fdt, nodename,"interrupt-map-mask" , -0x1800 ,0 ,0 ,/* devfn (PCI_SLOT(3)) */ +cpu_to_be16 (PCI_DEVFN (3 ,0 )),/* Slot 3 */ +0 ,0 ,0x7 /* PCI irq */ ); }
hw/pci-host/uninorth.c +2 -4
@@ -70,10 +70,8 @@ static uint32_t unin_get_config_reg(uint32_t reg, uint32_t addr)/* ... and then convert them to x86 format */ /* config pointer */ retval = (reg & (0xff -7 )) | (addr &7 ); -/* slot */ - retval |= slot <<11 ; -/* fn */ - retval |= func <<8 ; +/* slot, fn */ + retval |=PCI_DEVFN (slot, func) <<8 ; }trace_unin_get_config_reg (reg, addr, retval);
Signature · 1 line
2.26.2
Re: [PATCH 5/5] hw: Use the PCI_DEVFN() macro from 'hw/pci/pci.h'
Quoted 6 lines · Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé <[email protected]>
We already have a generic
PCI_DEVFN()macro in "hw/pci/pci.h" to pack the PCI slot/function identifiers, use it.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
ppc part
Quoted 36 lines
--- hw/arm/virt.c | 3 ++- hw/pci-host/uninorth.c | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-)hw/arm/virt.c +2
-1@@ -1144,7 +1144,8 @@ static void create_pcie_irq_map(const VirtMachineState *vms, full_irq_map, sizeof(full_irq_map));qemu_fdt_setprop_cells (vms->fdt, nodename,"interrupt-map-mask" , -0x1800 ,0 ,0 ,/* devfn (PCI_SLOT(3)) */ +cpu_to_be16 (PCI_DEVFN (3 ,0 )),/* Slot 3 */ +0 ,0 ,0x7 /* PCI irq */ ); }hw/pci-host/uninorth.c +2
-4@@ -70,10 +70,8 @@ static uint32_t unin_get_config_reg(uint32_t reg, uint32_t addr)/* ... and then convert them to x86 format */ /* config pointer */ retval = (reg & (0xff -7 )) | (addr &7 ); -/* slot */ - retval |= slot <<11 ; -/* fn */ - retval |= func <<8 ; +/* slot, fn */ + retval |=PCI_DEVFN (slot, func) <<8 ; }trace_unin_get_config_reg (reg, addr, retval);
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 8 lines · Philippe Mathieu-Daudé
Trivial patches using the generic PCI macros from "
hw/pci/pci.h".Philippe Mathieu-Daudé (5):
hw/pci-host/bonito: MakePCI_ADDR()macro more readable hw/pci-host: Use thePCI_BUILD_BDF()macro from 'hw/pci/pci.h' hw/pci-host/uninorth: Use thePCI_FUNC()macro from 'hw/pci/pci.h'
hw: Use thePCI_SLOT()macro from 'hw/pci/pci.h'
hw: Use thePCI_DEVFN()macro from 'hw/pci/pci.h'
As this series are trivial and Acked, I'm going to queue it via the mips-tree, as other reviewed patches depend on it.
Thanks,
Phil.
Michael S. Tsirkin
Acked-byQuoted 10 lines · Philippe Mathieu-Daudé
Quoted 8 lines · Philippe Mathieu-Daudé
Trivial patches using the generic PCI macros from "
hw/pci/pci.h".Philippe Mathieu-Daudé (5):
hw/pci-host/bonito: MakePCI_ADDR()macro more readable hw/pci-host: Use thePCI_BUILD_BDF()macro from 'hw/pci/pci.h' hw/pci-host/uninorth: Use thePCI_FUNC()macro from 'hw/pci/pci.h'
hw: Use thePCI_SLOT()macro from 'hw/pci/pci.h'
hw: Use thePCI_DEVFN()macro from 'hw/pci/pci.h'
Quoted 7 lines
As this series are trivial and Acked, I'm going to queue it via the mips-tree, as other reviewed patches depend on it.
Thanks,
Phil.
Fine.