Skip to content

Commit

Permalink
openrisc: fix virt_addr_valid
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonas Bonn committed Mar 6, 2012
1 parent 01c4d33 commit 2f099a2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/openrisc/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

Expand Down

0 comments on commit 2f099a2

Please sign in to comment.