mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 13:14:07 +08:00
riscv: mm: init: Pass a pointer to 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 this in the RISCV mm init code, so we can implement a strongly typed virt_to_pfn(). Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
c809202549
commit
a7d270d71a
@ -356,7 +356,7 @@ static phys_addr_t __init alloc_pte_late(uintptr_t va)
|
||||
unsigned long vaddr;
|
||||
|
||||
vaddr = __get_free_page(GFP_KERNEL);
|
||||
BUG_ON(!vaddr || !pgtable_pte_page_ctor(virt_to_page(vaddr)));
|
||||
BUG_ON(!vaddr || !pgtable_pte_page_ctor(virt_to_page((void *)vaddr)));
|
||||
|
||||
return __pa(vaddr);
|
||||
}
|
||||
@ -439,7 +439,7 @@ static phys_addr_t __init alloc_pmd_late(uintptr_t va)
|
||||
unsigned long vaddr;
|
||||
|
||||
vaddr = __get_free_page(GFP_KERNEL);
|
||||
BUG_ON(!vaddr || !pgtable_pmd_page_ctor(virt_to_page(vaddr)));
|
||||
BUG_ON(!vaddr || !pgtable_pmd_page_ctor(virt_to_page((void *)vaddr)));
|
||||
|
||||
return __pa(vaddr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user