aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 6af555c1c42a..71bc664efed5 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -388,7 +388,7 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_
388{ 388{
389 unsigned long pfn = pte_pfn(pte); 389 unsigned long pfn = pte_pfn(pte);
390 390
391 if (vma->vm_flags & VM_PFNMAP) { 391 if (unlikely(vma->vm_flags & VM_PFNMAP)) {
392 unsigned long off = (addr - vma->vm_start) >> PAGE_SHIFT; 392 unsigned long off = (addr - vma->vm_start) >> PAGE_SHIFT;
393 if (pfn == vma->vm_pgoff + off) 393 if (pfn == vma->vm_pgoff + off)
394 return NULL; 394 return NULL;
@@ -396,18 +396,12 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_
396 return NULL; 396 return NULL;
397 } 397 }
398 398
399 /* 399#ifdef CONFIG_DEBUG_VM
400 * Add some anal sanity checks for now. Eventually,
401 * we should just do "return pfn_to_page(pfn)", but
402 * in the meantime we check that we get a valid pfn,
403 * and that the resulting page looks ok.
404 *
405 * Remove this test eventually!
406 */
407 if (unlikely(!pfn_valid(pfn))) { 400 if (unlikely(!pfn_valid(pfn))) {
408 print_bad_pte(vma, pte, addr); 401 print_bad_pte(vma, pte, addr);
409 return NULL; 402 return NULL;
410 } 403 }
404#endif
411 405
412 /* 406 /*
413 * NOTE! We still have PageReserved() pages in the page 407 * NOTE! We still have PageReserved() pages in the page