Skip to content

Commit

Permalink
sh: convert nommu io{re,un}map() to static inline functions
Browse files Browse the repository at this point in the history
Recently, nommu iounmap() was converted from a static inline function to a
macro again, basically reverting commit 4580ba4 ("sh: Convert
iounmap() macros to inline functions").  With -Werror, this leads to build
failures like:

    drivers/iio/adc/xilinx-ams.c: In function `ams_iounmap_ps':
    drivers/iio/adc/xilinx-ams.c:1195:14: error: unused variable `ams' [-Werror=unused-variable]
     1195 |  struct ams *ams = data;
	  |              ^~~

Fix this by replacing the macros for ioremap() and iounmap() by static
inline functions, based on <asm-generic/io.h>.

Link: https://lkml.kernel.org/r/8d1b1766260961799b04035e7bc39a7f59729f72.1655708312.git.geert+renesas@glider.be
Fixes: 13f1fc8 ("sh: move the ioremap implementation out of line")
Signed-off-by: Geert Uytterhoeven <[email protected]>
Reported-by: kernel test robot <[email protected]>
Reported-by: Jonathan Cameron <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
geertu authored and akpm00 committed Jul 3, 2022
1 parent 73f37db commit d684e0a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/sh/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d684e0a

Please sign in to comment.