From c6f6b596a5a73e63e5e930c414375c0c389199ab Mon Sep 17 00:00:00 2001 From: Chris Metcalf Date: Mon, 24 May 2010 14:32:53 -0700 Subject: [PATCH] mm: make lowmem_page_address() use PFN_PHYS() for improved portability This ensures that platforms with lowmem PAs above 32 bits work correctly by avoiding truncating the PA during a left shift. Signed-off-by: Chris Metcalf Cc: Barry Song <21cnbao@gmail.com> Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 963f908af9d0..b969efb03787 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -13,6 +13,7 @@ #include #include #include +#include struct mempolicy; struct anon_vma; @@ -595,7 +596,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone, static __always_inline void *lowmem_page_address(struct page *page) { - return __va(page_to_pfn(page) << PAGE_SHIFT); + return __va(PFN_PHYS(page_to_pfn(page))); } #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) -- 2.34.1