Skip to contentSkip to conversation

s390: provide default ioremap and iounmap declaration

PATCH Applied Logan Gunthorpe 2 participants 2 messages May 29, 2017 – May 30, 2017 s390

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 s390: provide default ioremap and iounmap declaration

Move the CONFIG_PCI device so that ioremap and iounmap are always available. This looks safe as there's nothing PCI specific in the implementation of these functions.

I have designs to use these functions in scatterlist.c where they'd likely never be called without CONFIG_PCI set, but this is needed to compile such changes.

Cc Martin Schwidefsky <[email protected]>
Cc Heiko Carstens <[email protected]>
cc Sebastian Ott <[email protected]>
Cc Al Viro <[email protected]>

---

v2 of this patch is changed to simply move the CONFIG_PCI #ifdef to expose only a single set of functions as suggested by Heiko Carstens.

 arch/s390/include/asm/io.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/s390/include/asm/io.h +2 -2
index 437e9af96688..904e4b3af95d 100644
@@ -25,8 +25,6 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
 
 #define IO_SPACE_LIMIT 0
 
-#ifdef CONFIG_PCI
-
 #define ioremap_nocache(addr, size)	ioremap(addr, size)
 #define ioremap_wc			ioremap_nocache
 #define ioremap_wt			ioremap_nocache
@@ -49,6 +47,8 @@ static inline void ioport_unmap(void __iomem *p)
 {
 }
 
+#ifdef CONFIG_PCI
+
 /*
  * s390 needs a private implementation of pci_iomap since ioremap with its
  * offset parameter isn't sufficient. That's because BAR spaces are not

--
2.11.0

#1 lore raw
Quoted 45 lines · Logan Gunthorpe

Move the CONFIG_PCI device so that ioremap and iounmap are always available. This looks safe as there's nothing PCI specific in the implementation of these functions.

I have designs to use these functions in scatterlist.c where they'd likely never be called without CONFIG_PCI set, but this is needed to compile such changes.

Cc Martin Schwidefsky <[email protected]>
Cc Heiko Carstens <[email protected]>
cc Sebastian Ott <[email protected]>
Cc Al Viro <[email protected]>

---

v2 of this patch is changed to simply move the CONFIG_PCI #ifdef to expose only a single set of functions as suggested by Heiko Carstens.

 arch/s390/include/asm/io.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/s390/include/asm/io.h +2 -3
index 437e9af96688..904e4b3af95d 100644
@@ -25,8 +25,6 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
 
 #define IO_SPACE_LIMIT 0
 
-#ifdef CONFIG_PCI
-
 #define ioremap_nocache(addr, size)	ioremap(addr, size)
 #define ioremap_wc			ioremap_nocache
 #define ioremap_wt			ioremap_nocache
@@ -49,6 +47,8 @@ static inline void ioport_unmap(void __iomem *p)
 {
 }
 
+#ifdef CONFIG_PCI
+
 /*
  * s390 needs a private implementation of pci_iomap since ioremap with its
  * offset parameter isn't sufficient. That's because BAR spaces are not
--
Quoted 3 lines

2.11.0

Applied. The patch will go upstream via Martin's tree.

Thanks!
Sebastian