x86/xen: Make virt_to_pfn() a static inline
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 10 Aug 2023 07:27:04 +0000 (09:27 +0200)
committerJuergen Gross <jgross@suse.com>
Mon, 21 Aug 2023 07:52:29 +0000 (09:52 +0200)
commit067e4f174f6d4ecf8872ad93d859d57bab44f7b6
treee3ca256efdf0b85d1455569f9fc1d04eefc13ca4
parentd826c9e61c99120f8996f8fed6417167e32eb922
x86/xen: Make virt_to_pfn() a static inline

Making virt_to_pfn() a static inline 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.

Also fix all offending call sites to pass a (void *) rather
than an unsigned long. Since virt_to_mfn() is wrapping
virt_to_pfn() this function has become polymorphic as well
so the usage need to be fixed up.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20230810-virt-to-phys-x86-xen-v1-1-9e966d333e7a@linaro.org
Signed-off-by: Juergen Gross <jgross@suse.com>
arch/x86/include/asm/xen/page.h
arch/x86/xen/enlighten_pv.c
arch/x86/xen/mmu_pv.c
arch/x86/xen/setup.c