From: Joonsoo Kim Date: Wed, 12 Dec 2012 00:01:17 +0000 (-0800) Subject: mm, highmem: use PKMAP_NR() to calculate an index of pkmap X-Git-Tag: v3.8-rc1~175^2~45 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4de22c0584fb0566487b2cba5cdfbce346b18402;p=platform%2Fupstream%2Fkernel-adaptation-pc.git mm, highmem: use PKMAP_NR() to calculate an index of pkmap To calculate an index of pkmap, using PKMAP_NR() is more understandable and maintainable, so change it. Signed-off-by: Joonsoo Kim Cc: Mel Gorman Reviewed-by: Minchan Kim Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/highmem.c b/mm/highmem.c index 2da13a5..2576a71 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -99,7 +99,7 @@ struct page *kmap_to_page(void *vaddr) unsigned long addr = (unsigned long)vaddr; if (addr >= PKMAP_ADDR(0) && addr < PKMAP_ADDR(LAST_PKMAP)) { - int i = (addr - PKMAP_ADDR(0)) >> PAGE_SHIFT; + int i = PKMAP_NR(addr); return pte_page(pkmap_page_table[i]); }