“1d5a0f8033c12832f6f05778afd73e9e40b3129c”上不存在“...sun/git@gitcode.net:openanolis/dragonwell8_jdk.git”
提交 cce45fde 编写于 作者: G Geert Uytterhoeven 提交者: Zheng Zengkai

sh: convert nommu io{re,un}map() to static inline functions

stable inclusion
from stable-v5.10.132
commit 41007669fc3b4c968c54b81088c2bbc18d8affe4
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5YS3T

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=41007669fc3b4c968c54b81088c2bbc18d8affe4

--------------------------------

commit d684e0a5 upstream.

Recently, nommu iounmap() was converted from a static inline function to a
macro again, basically reverting commit 4580ba4a ("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: 13f1fc87 ("sh: move the ioremap implementation out of line")
Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Reported-by: Nkernel test robot <lkp@intel.com>
Reported-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 655e5278
...@@ -271,8 +271,12 @@ static inline void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size, ...@@ -271,8 +271,12 @@ static inline void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size,
#endif /* CONFIG_HAVE_IOREMAP_PROT */ #endif /* CONFIG_HAVE_IOREMAP_PROT */
#else /* CONFIG_MMU */ #else /* CONFIG_MMU */
#define iounmap(addr) do { } while (0) static inline void __iomem *ioremap(phys_addr_t offset, size_t size)
#define ioremap(offset, size) ((void __iomem *)(unsigned long)(offset)) {
return (void __iomem *)(unsigned long)offset;
}
static inline void iounmap(volatile void __iomem *addr) { }
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
#define ioremap_uc ioremap #define ioremap_uc ioremap
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册