Skip to contentSkip to conversation

pci: use uint32_t for unsigned long values

PATCH New Paolo Bonzini 1 participant 1 message Feb 28, 2020 KVM

lore
Share & tools
lore

Paolo Bonzini

author maintainer
#0 lore raw

PATCH 1/1 pci: use uint32_t for unsigned long values

From: Bill Wendling <[email protected]>

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.

---
 lib/linux/pci_regs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/linux/pci_regs.h +2 -2
index 1becea8..7c566d0 100644
@@ -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) */
Signature · 1 line
1.8.3.1