Skip to content

Commit 869dcfd

Browse files
labbottwildea01
authored andcommitted
arm64: Add cast for virt_to_pfn
virt_to_pfn lacks a cast at the top level. Don't rely on __virt_to_phys and explicitly cast to unsigned long. Reviewed-by: Mark Rutland <mark.rutland@arm.com> Tested-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Laura Abbott <labbott@redhat.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 9e22eb6 commit 869dcfd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/include/asm/memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static inline void *phys_to_virt(phys_addr_t x)
209209
#define __pa(x) __virt_to_phys((unsigned long)(x))
210210
#define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x)))
211211
#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
212-
#define virt_to_pfn(x) __phys_to_pfn(__virt_to_phys(x))
212+
#define virt_to_pfn(x) __phys_to_pfn(__virt_to_phys((unsigned long)(x)))
213213

214214
/*
215215
* virt_to_page(k) convert a _valid_ virtual address to struct page *

0 commit comments

Comments
 (0)