From: Joonsoo Kim Date: Fri, 9 Nov 2012 03:04:06 +0000 (+1100) Subject: mm, highmem: use PKMAP_NR() to calculate an index of pkmap X-Git-Tag: next-20121109~9^2~226 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=853dc479e7120fab4423417eadf4bc6ff9caeaee;p=karo-tx-linux.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 --- diff --git a/mm/highmem.c b/mm/highmem.c index 2a07f97dabf1..017ccccfb4aa 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]); }