Skip to contentSkip to conversation

sh: provide unxlate_dev_mem_ptr() in asm/io.h

PATCH Applied Guenter Roeck 3 participants 4 messages Jul 4, 2023 – Jul 5, 2023 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: provide unxlate_dev_mem_ptr() in asm/io.h

The unxlate_dev_mem_ptr() function has no prototype on the sh architecture, which does not include asm-generic/io.h. This results in the following build failure.

drivers/char/mem.c: In function 'read_mem':
drivers/char/mem.c:164:25: error: implicit declaration of function 'unxlate_dev_mem_ptr'

This compile error is now seen because commit 99b619b37ae1 ("mips: provide unxlate_dev_mem_ptr() in asm/io.h") removed the weak function which was previously in place to handle the problem.

Add a trivial macro to the sh header to provide the now missing dummy function.

Fixes 99b619b37ae1 ("mips: provide unxlate_dev_mem_ptr() in asm/io.h")
Cc Arnd Bergmann <[email protected]>
---
 arch/sh/include/asm/io.h | 1 +
 1 file changed, 1 insertion(+)
arch/sh/include/asm/io.h +1 -0
index fba90e670ed4..d8f3537ef57f 100644
@@ -286,6 +286,7 @@ static inline void iounmap(volatile void __iomem *addr) { }
  * access
  */
 #define xlate_dev_mem_ptr(p)	__va(p)
+#define unxlate_dev_mem_ptr(p, v) do { } while (0)
 
 #define ARCH_HAS_VALID_PHYS_ADDR_RANGE
 int valid_phys_addr_range(phys_addr_t addr, size_t size);
Signature · 1 line
2.39.2
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Guenter Roeck

The unxlate_dev_mem_ptr() function has no prototype on the sh architecture, which does not include asm-generic/io.h. This results in the following build failure.

drivers/char/mem.c: In function 'read_mem':
drivers/char/mem.c:164:25: error: implicit declaration of function 'unxlate_dev_mem_ptr'

This compile error is now seen because commit 99b619b37ae1 ("mips: provide unxlate_dev_mem_ptr() in asm/io.h") removed the weak function which was previously in place to handle the problem.

Quoted 6 lines

Add a trivial macro to the sh header to provide the now missing dummy function.

Fixes 99b619b37ae1 ("mips: provide unxlate_dev_mem_ptr() in asm/io.h")
Cc Arnd Bergmann <[email protected]>

Ideally, we should use the asm-generic/io.h header here, but as a hotfix this should do.

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Guenter Roeck
Quoted 26 lines · Guenter Roeck

The unxlate_dev_mem_ptr() function has no prototype on the sh architecture, which does not include asm-generic/io.h. This results in the following build failure.

drivers/char/mem.c: In function 'read_mem':
drivers/char/mem.c:164:25: error: implicit declaration of function 'unxlate_dev_mem_ptr'

This compile error is now seen because commit 99b619b37ae1 ("mips: provide unxlate_dev_mem_ptr() in asm/io.h") removed the weak function which was previously in place to handle the problem.

Add a trivial macro to the sh header to provide the now missing dummy function.

Fixes 99b619b37ae1 ("mips: provide unxlate_dev_mem_ptr() in asm/io.h")
Cc Arnd Bergmann <[email protected]>
---
 arch/sh/include/asm/io.h | 1 +
 1 file changed, 1 insertion(+)
arch/sh/include/asm/io.h +0 -0
index fba90e670ed4..d8f3537ef57f 100644

arch/sh/include/asm/io.h static inline void iounmap(volatile void __iomem *addr) { } · line 292

Quoted 7 lines
arch/sh/include/asm/io.h +1 -0
@@ -286,6 +286,7 @@ static inline void iounmap(volatile void __iomem *addr) { }
  * access
  */
 #define xlate_dev_mem_ptr(p)	__va(p)
+#define unxlate_dev_mem_ptr(p, v) do { } while (0)
 
 #define ARCH_HAS_VALID_PHYS_ADDR_RANGE
 int valid_phys_addr_range(phys_addr_t addr, size_t size);

I'm going to pick this up tomorrow before sending my PR to Linus.

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
maintainer Applied
#3 lore raw
In reply to Guenter Roeck
Quoted 26 lines · Guenter Roeck

The unxlate_dev_mem_ptr() function has no prototype on the sh architecture, which does not include asm-generic/io.h. This results in the following build failure.

drivers/char/mem.c: In function 'read_mem':
drivers/char/mem.c:164:25: error: implicit declaration of function 'unxlate_dev_mem_ptr'

This compile error is now seen because commit 99b619b37ae1 ("mips: provide unxlate_dev_mem_ptr() in asm/io.h") removed the weak function which was previously in place to handle the problem.

Add a trivial macro to the sh header to provide the now missing dummy function.

Fixes 99b619b37ae1 ("mips: provide unxlate_dev_mem_ptr() in asm/io.h")
Cc Arnd Bergmann <[email protected]>
---
 arch/sh/include/asm/io.h | 1 +
 1 file changed, 1 insertion(+)
arch/sh/include/asm/io.h +0 -0
index fba90e670ed4..d8f3537ef57f 100644

arch/sh/include/asm/io.h static inline void iounmap(volatile void __iomem *addr) { } · line 292

Quoted 7 lines
arch/sh/include/asm/io.h +1 -0
@@ -286,6 +286,7 @@ static inline void iounmap(volatile void __iomem *addr) { }
  * access
  */
 #define xlate_dev_mem_ptr(p)	__va(p)
+#define unxlate_dev_mem_ptr(p, v) do { } while (0)
 
 #define ARCH_HAS_VALID_PHYS_ADDR_RANGE
 int valid_phys_addr_range(phys_addr_t addr, size_t size);

Applied to my for-next tree for 6.5. PR will be sent tomorrow.

Thanks,
Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913