summaryrefslogtreecommitdiff
path: root/mm/highmem.c
diff options
context:
space:
mode:
authorJoonsoo Kim <js1304@gmail.com>2012-12-12 04:01:17 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 05:22:24 +0400
commit4de22c0584fb0566487b2cba5cdfbce346b18402 (patch)
treed70da2627db4524c23c6338a5ee65e9758376420 /mm/highmem.c
parent6555bc035731eab76c0901925034465d3ad2099c (diff)
downloadlinux-4de22c0584fb0566487b2cba5cdfbce346b18402.tar.xz
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 <js1304@gmail.com> Cc: Mel Gorman <mel@csn.ul.ie> Reviewed-by: Minchan Kim <minchan@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/highmem.c')
-rw-r--r--mm/highmem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/highmem.c b/mm/highmem.c
index 2da13a5c50e2..2576a7118981 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]);
}