Commit e72590fa authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Andrew Morton

sh: mm: re-add lost __ref to ioremap_prot() to fix modpost warning

When __ioremap_caller() was replaced by ioremap_prot(), the __ref
annotation added in commit af141531 ("sh: Flag __ioremap_caller()
__init_refok.") was removed, causing a modpost warning:

    WARNING: modpost: vmlinux: section mismatch in reference: ioremap_prot+0x88 (section: .text) -> ioremap_fixed (section: .init.text)

ioremap_prot() calls ioremap_fixed() (which is marked __init), but only
before mem_init_done becomes true, so this is safe.  Hence fix this by
re-adding the lost __ref.

Link: https://lkml.kernel.org/r/20230911093850.1517389-1-geert+renesas@glider.be
Fixes: 0453c9a7 ("sh: mm: convert to GENERIC_IOREMAP")
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarBaoquan He <bhe@redhat.com>
Reviewed-by: default avatarJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent ce9ecca0
...@@ -72,8 +72,8 @@ __ioremap_29bit(phys_addr_t offset, unsigned long size, pgprot_t prot) ...@@ -72,8 +72,8 @@ __ioremap_29bit(phys_addr_t offset, unsigned long size, pgprot_t prot)
#define __ioremap_29bit(offset, size, prot) NULL #define __ioremap_29bit(offset, size, prot) NULL
#endif /* CONFIG_29BIT */ #endif /* CONFIG_29BIT */
void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size, void __iomem __ref *ioremap_prot(phys_addr_t phys_addr, size_t size,
unsigned long prot) unsigned long prot)
{ {
void __iomem *mapped; void __iomem *mapped;
pgprot_t pgprot = __pgprot(prot); pgprot_t pgprot = __pgprot(prot);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment