2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-17 01:34:00 +08:00

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>
This commit is contained in:
Jonas Bonn 2012-03-02 07:56:09 +01:00
parent 01c4d33ac5
commit 2f099a280e

View File

@ -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__ */