riscv: Make virt_to_pfn() a real function
Making virt_to_pfn() a proper function taking a strongly typed
(const void *) makes the contract of a passing a pointer of that
type to the function explicit and exposes any misuse of the
macro virt_to_pfn() acting polymorphic and accepting many types
such as (void *), (unitptr_t) or (unsigned long) as arguments
without warnings.
On other archs I chose to create a static inline in the header,
but the way that RISCV is engineered a separate file for
physmem makes this approach better for RISCV. Create mm/physmem.c
and rename the existing mm/physmem.c to mm/physmem-debug.c to
reflect its actual use.
Also make sure virt_addr_valid() passes a pointer and nothing
else.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
4 files changed