lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 15 Feb 2022 12:03:19 +0000
From:   Jonathan Cameron <Jonathan.Cameron@...wei.com>
To:     Geert Uytterhoeven <geert+renesas@...der.be>
CC:     Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Rich Felker <dalias@...c.org>, Christoph Hellwig <hch@....de>,
        Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
        kernel test robot <lkp@...el.com>,
        "Arnd Bergmann" <arnd@...db.de>, <linux-sh@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sh: Convert nommu io{re,un}map() to static inline
 functions

On Tue, 15 Feb 2022 09:51:05 +0100
Geert Uytterhoeven <geert+renesas@...der.be> 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:
> 
>     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>.
> 
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> Fixes: 13f1fc870dd74713 ("sh: move the ioremap implementation out of line")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>

Looks good.

Thanks for the quick response.

Acked-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>

> ---
> This is actually the third time this change was made, as Christoph
> converted iounmap() to a macro before in commit 98c90e5ea34e98bd ("sh:
> remove __iounmap"), reverting commit 733f0025f0fb43e3 ("sh: prevent
> warnings when using iounmap").
> 
> Probably sh-nommu should include <asm-generic/io.h>, but that would
> require a lot more changes.
> ---
>  arch/sh/include/asm/io.h | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ