aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-02-28 12:11:04 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2020-02-28 12:11:04 +0100
commitb2402d33d42b092d65845fc956e3cdbe01628eca (patch)
tree0c00f318f7fc601d2d51ee32a49665d4905a9061
parent31eaca95e90fc4e934aff85a4a476e624c74e2bc (diff)
downloadkvm-unit-tests-b2402d33d42b092d65845fc956e3cdbe01628eca.tar.gz
pci: use uint32_t for unsigned long values
The "pci_bar_*" functions use 64-bit masks, but the results are assigned to 32-bit variables; clang complains. Use signed masks that can be sign-extended at will. Reported-by: Bill Wendling <morbo@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--lib/linux/pci_regs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/linux/pci_regs.h b/lib/linux/pci_regs.h
index 1becea8..7c566d0 100644
--- a/lib/linux/pci_regs.h
+++ b/lib/linux/pci_regs.h
@@ -96,8 +96,8 @@
#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */
#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */
#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */
-#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
-#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL)
+#define PCI_BASE_ADDRESS_MEM_MASK (~0x0f)
+#define PCI_BASE_ADDRESS_IO_MASK (~0x03)
/* bit 1 is reserved if address_space = 1 */
/* Header type 0 (normal devices) */