Skip to contentSkip to conversation

PCI: Constify pci_register_io_range stub fwnode_handle

PATCH In review Arnd Bergmann 3 participants 3 messages Oct 16, 2024 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: Constify pci_register_io_range stub fwnode_handle

From: Arnd Bergmann <[email protected]>

The patch to change the argument types for pci_register_io_range() only caught one of the two implementations, but missed the empty version:

drivers/of/address.c: In function 'of_pci_range_to_resource':
drivers/of/address.c:244:45: error: passing argument 1 of 'pci_register_io_range' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
244 | err = pci_register_io_range(&np->fwnode, range->cpu_addr,
| ^~~~~~~~~~~
In file included from drivers/of/address.c:12:
include/linux/pci.h:1559:49: note: expected 'struct fwnode_handle *' but argument is of type 'const struct fwnode_handle *'
1559 | int pci_register_io_range(struct fwnode_handle *fwnode, phys_addr_t addr,

      |                           ~~~~~~~~~~~~~~~~~~~~~~^~~~~~

Change this the same way.

Fixes 6ad99a07e6d2 ("PCI: Constify pci_register_io_range() fwnode_handle")

---
If possible, please fold this fixup into the original patch

---
 include/linux/pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/pci.h +1 -1
index 11421ae5c558..733ff6570e2d 100644
@@ -2019,7 +2019,7 @@ static inline int pci_request_regions(struct pci_dev *dev, const char *res_name)
 { return -EIO; }
 static inline void pci_release_regions(struct pci_dev *dev) { }
 
-static inline int pci_register_io_range(struct fwnode_handle *fwnode,
+static inline int pci_register_io_range(const struct fwnode_handle *fwnode,
 					phys_addr_t addr, resource_size_t size)
 { return -EINVAL; }
 
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The patch to change the argument types for pci_register_io_range() only caught one of the two implementations, but missed the empty version:

drivers/of/address.c: In function 'of_pci_range_to_resource':
drivers/of/address.c:244:45: error: passing argument 1 of 'pci_register_io_range' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
244 | err = pci_register_io_range(&np->fwnode, range->cpu_addr,
| ^~~~~~~~~~~
In file included from drivers/of/address.c:12:
include/linux/pci.h:1559:49: note: expected 'struct fwnode_handle *' but argument is of type 'const struct fwnode_handle *'
1559 | int pci_register_io_range(struct fwnode_handle *fwnode, phys_addr_t addr,

Quoted 6 lines
      |                           ~~~~~~~~~~~~~~~~~~~~~~^~~~~~

Change this the same way.

Fixes 6ad99a07e6d2 ("PCI: Constify pci_register_io_range() fwnode_handle")

Looks fine.

Signature · 2 lines
Damien Le Moal
Western Digital Research
Acked-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 13 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The patch to change the argument types for pci_register_io_range() only caught one of the two implementations, but missed the empty version:

drivers/of/address.c: In function 'of_pci_range_to_resource':
drivers/of/address.c:244:45: error: passing argument 1 of 'pci_register_io_range' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
244 | err = pci_register_io_range(&np->fwnode, range->cpu_addr,
| ^~~~~~~~~~~
In file included from drivers/of/address.c:12:
include/linux/pci.h:1559:49: note: expected 'struct fwnode_handle *' but argument is of type 'const struct fwnode_handle *'
1559 | int pci_register_io_range(struct fwnode_handle *fwnode, phys_addr_t addr,

Quoted 5 lines
      |                           ~~~~~~~~~~~~~~~~~~~~~~^~~~~~

Change this the same way.

Fixes 6ad99a07e6d2 ("PCI: Constify pci_register_io_range() fwnode_handle")

I assume Rob took the original and will take care of this as well:

https://lore.kernel.org/all/20241010220747.GA579765@bhelgaas/

Quoted 23 lines

---
If possible, please fold this fixup into the original patch

---
 include/linux/pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/pci.h +1 -1
index 11421ae5c558..733ff6570e2d 100644
@@ -2019,7 +2019,7 @@ static inline int pci_request_regions(struct pci_dev *dev, const char *res_name)
 { return -EIO; }
 static inline void pci_release_regions(struct pci_dev *dev) { }
 
-static inline int pci_register_io_range(struct fwnode_handle *fwnode,
+static inline int pci_register_io_range(const struct fwnode_handle *fwnode,
 					phys_addr_t addr, resource_size_t size)
 { return -EINVAL; }
 
Signature · 1 line
2.39.5