From 2f099a280e92c259598d8ed8da82c7ec2dd49845 Mon Sep 17 00:00:00 2001 From: Jonas Bonn Date: Fri, 2 Mar 2012 07:56:09 +0100 Subject: openrisc: fix virt_addr_valid virt_addr_valid() shouldn't be comparing the address to memory_end which is a phys_addr_t. Change this to do like other arches and check that the address falls within a valid page frame. Signed-off-by: Jonas Bonn --- arch/openrisc/include/asm/page.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/openrisc') diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h index b041b344b229..c4ffaee5f940 100644 --- a/arch/openrisc/include/asm/page.h +++ b/arch/openrisc/include/asm/page.h @@ -94,8 +94,7 @@ extern unsigned long memory_end; #define pfn_valid(pfn) ((pfn) < max_mapnr) -#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ - ((void *)(kaddr) < (void *)memory_end)) +#define virt_addr_valid(kaddr) (pfn_valid(virt_to_pfn(kaddr))) #endif /* __ASSEMBLY__ */ -- cgit v1.2.3