aboutsummaryrefslogtreecommitdiff
path: root/hw/pci-host/uninorth.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-10-12 08:36:41 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-01-04 23:24:44 +0100
commit4934e479f1806e69cfab637156fe136994619c03 (patch)
treedc3201448d28816acdf3cd52f435ba6fddf10620 /hw/pci-host/uninorth.c
parent8d40def66d744a964c2675a19c11f644d288dd4f (diff)
hw: Use the PCI_DEVFN() macro from 'hw/pci/pci.h'
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é <f4bug@amsat.org> Acked-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20201012124506.3406909-6-philmd@redhat.com> Reviewed-by: Huacai Chen <chenhuacai@kernel.org> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20201231224911.1467352-4-f4bug@amsat.org>
Diffstat (limited to 'hw/pci-host/uninorth.c')
-rw-r--r--hw/pci-host/uninorth.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
index f0a4d8c717..d25b62d6a5 100644
--- a/hw/pci-host/uninorth.c
+++ b/hw/pci-host/uninorth.c
@@ -68,10 +68,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);