[PATCH] ARM: Stricten arguments to virt_to_pfn()

Russell King (Oracle) linux at armlinux.org.uk
Mon May 16 05:27:20 PDT 2022


On Mon, May 16, 2022 at 02:16:07PM +0200, Linus Walleij wrote:
> The kernel convention is that the argument passed to virt_to_pfn()
> (virtual address to page frame number) needs to be an unsigned long,
> but ARM has avoided this by including a cast to (unsigned long)
> inside the definition of virt_to_pfn() itself. This creates problems
> if we want to make virt_to_pfn() an actual function with a typed argument,
> so fix up the offending call sites.

Why do we need all these additional messy casts all over the place?
We should not be creating messy code with stupid casts all over the
place.

virt_*() should be taking a _virtual_ address - in other words, a
pointer.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!



More information about the linux-arm-kernel mailing list