summaryrefslogtreecommitdiffstats
path: root/arch/openrisc
diff options
context:
space:
mode:
authorJonas Bonn <jonas@southpole.se>2012-03-02 07:56:09 +0100
committerJonas Bonn <jonas@southpole.se>2012-03-06 10:36:08 +0100
commit2f099a280e92c259598d8ed8da82c7ec2dd49845 (patch)
treef0d748adde2badc47f2d07316b08cc4e5aca214b /arch/openrisc
parent01c4d33ac5ca7920f0e0f6b25bdfd3fa479fd973 (diff)
downloadop-kernel-dev-2f099a280e92c259598d8ed8da82c7ec2dd49845.zip
op-kernel-dev-2f099a280e92c259598d8ed8da82c7ec2dd49845.tar.gz
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 <jonas@southpole.se>
Diffstat (limited to 'arch/openrisc')
-rw-r--r--arch/openrisc/include/asm/page.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/openrisc/include/asm/page.h b/arch/openrisc/include/asm/page.h
index b041b34..c4ffaee 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__ */
OpenPOWER on IntegriCloud