Skip to content

Commit

Permalink
kernel/iomem.c: remove __weak ioremap_cache helper
Browse files Browse the repository at this point in the history
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.

Link: https://lkml.kernel.org/r/20230726145432.1617809-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Arnd Bergmann authored and Andrew Morton committed Aug 21, 2023
1 parent 1cac4c0 commit 68af051
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions kernel/iomem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 68af051

Please sign in to comment.