Skip to contentSkip to conversation

PCI: Make PCI_ROM_ADDRESS_MASK a 32-bit constant

PATCH Superseded Matthias Kaehlcke 2 participants 3 messages Apr 11, 2017 – Apr 14, 2017 PCI

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 PCI: Make PCI_ROM_ADDRESS_MASK a 32-bit constant

A 64-bit value is not needed since a PCI ROM address consists in 32 bits. This fixes a clang warning about "implicit conversion from 'unsigned long' to 'u32'".

---
Changes in v2:
- Define PCI_ROM_ADDRESS_MASK as a 32-bit constant instead of using a cast
- Updated commit message

 include/uapi/linux/pci_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/pci_regs.h +1 -1
index 634c9c44ed6c..fff521c9458c 100644
@@ -114,7 +114,7 @@
 #define PCI_SUBSYSTEM_ID	0x2e
 #define PCI_ROM_ADDRESS		0x30	/* Bits 31..11 are address, 10..1 reserved */
 #define  PCI_ROM_ADDRESS_ENABLE	0x01
-#define PCI_ROM_ADDRESS_MASK	(~0x7ffUL)
+#define PCI_ROM_ADDRESS_MASK	(~0x7ffU)
 
 #define PCI_CAPABILITY_LIST	0x34	/* Offset of first capability list entry */
 
Signature · 1 line
2.12.2.715.g7642488e1d-goog
#1 lore raw
Quoted 18 lines · Matthias Kaehlcke

A 64-bit value is not needed since a PCI ROM address consists in 32 bits. This fixes a clang warning about "implicit conversion from 'unsigned long' to 'u32'".

---
Changes in v2:
- Define PCI_ROM_ADDRESS_MASK as a 32-bit constant instead of using a cast
- Updated commit message

 include/uapi/linux/pci_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/pci_regs.h +0 -0
index 634c9c44ed6c..fff521c9458c 100644

include/uapi/linux/pci_regs.h line 117

Quoted 5 lines
include/uapi/linux/pci_regs.h +1 -1
@@ -114,7 +114,7 @@
 #define PCI_SUBSYSTEM_ID	0x2e
 #define PCI_ROM_ADDRESS		0x30	/* Bits 31..11 are address, 10..1 reserved */
 #define  PCI_ROM_ADDRESS_ENABLE	0x01
-#define PCI_ROM_ADDRESS_MASK	(~0x7ffUL)
+#define PCI_ROM_ADDRESS_MASK	(~0x7ffU)

Does this mean we can remove the "(u32)" casts in __pci_read_base() and pci_std_update_resource()? If so, can you do that in the same patch?

Quoted 5 lines
include/uapi/linux/pci_regs.h +0 -0
 #define PCI_CAPABILITY_LIST	0x34	/* Offset of first capability list entry */
 
Signature · 1 line
2.12.2.715.g7642488e1d-goog
#2 lore raw

El Fri, Apr 14, 2017 at 10:43:40AM -0500 Bjorn Helgaas ha dit:

Quoted 14 lines · Matthias Kaehlcke
Quoted 13 lines

A 64-bit value is not needed since a PCI ROM address consists in 32 bits. This fixes a clang warning about "implicit conversion from 'unsigned long' to 'u32'".

---
Changes in v2:
- Define PCI_ROM_ADDRESS_MASK as a 32-bit constant instead of using a cast
- Updated commit message

 include/uapi/linux/pci_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

include/uapi/linux/pci_regs.h line 117

Quoted 10 lines
include/uapi/linux/pci_regs.h +1 -1
index 634c9c44ed6c..fff521c9458c 100644
@@ -114,7 +114,7 @@
 #define PCI_SUBSYSTEM_ID	0x2e
 #define PCI_ROM_ADDRESS		0x30	/* Bits 31..11 are address, 10..1 reserved */
 #define  PCI_ROM_ADDRESS_ENABLE	0x01
-#define PCI_ROM_ADDRESS_MASK	(~0x7ffUL)
+#define PCI_ROM_ADDRESS_MASK	(~0x7ffU)

Does this mean we can remove the "(u32)" casts in __pci_read_base() and pci_std_update_resource()?

Indeed

Quoted 1 line

If so, can you do that in the same patch?

Will do

Matthias