Message ID | 8d1b1766260961799b04035e7bc39a7f59729f72.1655708312.git.geert+renesas@glider.be (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] sh: Convert nommu io{re,un}map() to static inline functions | expand |
On Mon, Jun 20, 2022 at 09:01:43AM +0200, Geert Uytterhoeven wrote: > Recently, nommu iounmap() was converted from a static inline function to > a macro again, basically reverting commit 4580ba4ad2e6b8dd ("sh: Convert > iounmap() macros to inline functions"). With -Werror, this leads to > build failures like: Stupid question: Is there any reason sh-nommu can't just use the generic nommu ioremap from asm-generic/io.h? Then again how long it takes to to fix any sh bugs I'm still wondering if we shouldn't just drop sh entirely given how much of a drag it is on everyone.
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index cf9a3ec32406f856..fba90e670ed41d48 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -271,8 +271,12 @@ static inline void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size, #endif /* CONFIG_HAVE_IOREMAP_PROT */ #else /* CONFIG_MMU */ -#define iounmap(addr) do { } while (0) -#define ioremap(offset, size) ((void __iomem *)(unsigned long)(offset)) +static inline void __iomem *ioremap(phys_addr_t offset, size_t size) +{ + return (void __iomem *)(unsigned long)offset; +} + +static inline void iounmap(volatile void __iomem *addr) { } #endif /* CONFIG_MMU */ #define ioremap_uc ioremap