diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2022-06-03 11:40:24 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2023-05-29 12:27:07 +0300 |
commit | 8f246087724a2f902a5deb2013f73b7516b2276e (patch) | |
tree | 4eb5188277a74690bdeba1ce4a0cfce75caaa2c7 /arch/m68k/mm/mcfmmu.c | |
parent | 9b2d38b4e4a4651ac6efc8ca1a1882c0d4f12937 (diff) | |
download | linux-8f246087724a2f902a5deb2013f73b7516b2276e.tar.xz |
m68k: Pass a pointer to virt_to_pfn() virt_to_page()
Functions that work on a pointer to virtual memory such as
virt_to_pfn() and users of that function such as
virt_to_page() are supposed to pass a pointer to virtual
memory, ideally a (void *) or other pointer. However since
many architectures implement virt_to_pfn() as a macro,
this function becomes polymorphic and accepts both a
(unsigned long) and a (void *).
Fix up the offending calls in arch/m68k with explicit casts.
The page table include <asm/pgtable.h> will include different
variants of the defines depending on whether you build for
classic m68k, ColdFire or Sun3, so fix all variants.
Delete Coldfire pte_pagenr() which was using unsigned long
semantics from __pte_page().
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/m68k/mm/mcfmmu.c')
-rw-r--r-- | arch/m68k/mm/mcfmmu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c index 70aa0979e027..278e85fcecd4 100644 --- a/arch/m68k/mm/mcfmmu.c +++ b/arch/m68k/mm/mcfmmu.c @@ -69,7 +69,8 @@ void __init paging_init(void) /* now change pg_table to kernel virtual addresses */ for (i = 0; i < PTRS_PER_PTE; ++i, ++pg_table) { - pte_t pte = pfn_pte(virt_to_pfn(address), PAGE_INIT); + pte_t pte = pfn_pte(virt_to_pfn((void *)address), + PAGE_INIT); if (address >= (unsigned long) high_memory) pte_val(pte) = 0; |