At this point, we're dealing with 32-bit addresses, therefore downcast the masks to 32-bits. Signed-off-by: Bill Wendling <morbo@xxxxxxxxxx> --- lib/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pci.c b/lib/pci.c index daa33e1..1b85411 100644 --- a/lib/pci.c +++ b/lib/pci.c @@ -107,7 +107,8 @@ pcidevaddr_t pci_find_dev(uint16_t vendor_id, uint16_t device_id) uint32_t pci_bar_mask(uint32_t bar) { return (bar & PCI_BASE_ADDRESS_SPACE_IO) ? - PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK; + (uint32_t)PCI_BASE_ADDRESS_IO_MASK : + (uint32_t)PCI_BASE_ADDRESS_MEM_MASK; } uint32_t pci_bar_get(struct pci_dev *dev, int bar_num) -- 2.24.0.rc1.363.gb1bccd3e3d-goog