[PATCH] ppc: make phys_mem_access_prot() work with pfns instead of addresses
[sfrench/cifs-2.6.git] / arch / ppc / mm / init.c
index db94efd253692890443aed18d09f145c8199e88e..99b48abd32969d8cfb485dc87b105bce9482bfb7 100644 (file)
@@ -637,18 +637,16 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
  */
 int page_is_ram(unsigned long pfn)
 {
-       unsigned long paddr = (pfn << PAGE_SHIFT);
-
-       return paddr < __pa(high_memory);
+       return pfn < max_pfn;
 }
 
-pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr,
+pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
                              unsigned long size, pgprot_t vma_prot)
 {
        if (ppc_md.phys_mem_access_prot)
-               return ppc_md.phys_mem_access_prot(file, addr, size, vma_prot);
+               return ppc_md.phys_mem_access_prot(file, pfn, size, vma_prot);
 
-       if (!page_is_ram(addr >> PAGE_SHIFT))
+       if (!page_is_ram(pfn))
                vma_prot = __pgprot(pgprot_val(vma_prot)
                                    | _PAGE_GUARDED | _PAGE_NO_CACHE);
        return vma_prot;