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:   Thu, 27 Jul 2023 18:22:31 +0800
From:   Baoquan He <bhe@...hat.com>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iomem: remove __weak ioremap_cache helper

On 07/26/23 at 04:54pm, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> No portable code calls into this function any more, and on
> architectures that don't use or define their own, it causes
> a warning:
> 
> kernel/iomem.c:10:22: warning: no previous prototype for 'ioremap_cache' [-Wmissing-prototypes]
>    10 | __weak void __iomem *ioremap_cache(resource_size_t offset, unsigned long size)
> 
> Fold it into the only caller that uses it on architectures
> without the #define.
> 
> Note that the fallback to ioremap is probably still wrong on
> those architectures, but this is what it's always done there.
> 
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  kernel/iomem.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/kernel/iomem.c b/kernel/iomem.c
> index 9682471e64717..dc2120776e1c3 100644
> --- a/kernel/iomem.c
> +++ b/kernel/iomem.c
> @@ -5,18 +5,14 @@
>  #include <linux/mm.h>
>  #include <linux/ioremap.h>
>  
> -#ifndef ioremap_cache
> -/* temporary while we convert existing ioremap_cache users to memremap */
> -__weak void __iomem *ioremap_cache(resource_size_t offset, unsigned long size)
> -{
> -	return ioremap(offset, size);
> -}
> -#endif
> -
>  #ifndef arch_memremap_wb
>  static void *arch_memremap_wb(resource_size_t offset, unsigned long size)
>  {
> +#ifdef ioremap_cache
>  	return (__force void *)ioremap_cache(offset, size);
> +#else
> +	return (__force void *)ioremap(offset, size);
> +#endif
>  }
>  #endif

This looks good to me, thanks.

Reviewed-by: Baoquan He <bhe@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ