]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - mm/highmem.c
mm, highmem: use PKMAP_NR() to calculate an index of pkmap
[~shefty/rdma-dev.git] / mm / highmem.c
index 2da13a5c50e2b48e8fe8dea34d4bd4835c127da9..2576a71189815abfd7bcf86c88ff3647e4a17c23 100644 (file)
@@ -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]);
        }