Skip to content

Commit

Permalink
mm, highmem: use PKMAP_NR() to calculate an index of pkmap
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joonsoo Kim authored and Linus Torvalds committed Dec 12, 2012
1 parent 6555bc0 commit 4de22c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down

0 comments on commit 4de22c0

Please sign in to comment.