Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
int ret;
pgd = pgd_offset(vma->vm_mm, address);
- if (pgd_none(*pgd))
- goto no_pgd;
- if (pgd_bad(*pgd))
- goto bad_pgd;
+ if (pgd_none_or_clear_bad(pgd))
+ return 0;
pmd = pmd_offset(pgd, address);
- if (pmd_none(*pmd))
- goto no_pmd;
- if (pmd_bad(*pmd))
- goto bad_pmd;
+ if (pmd_none_or_clear_bad(pmd))
+ return 0;
pte = pte_offset_map(pmd, address);
pte_unmap(pte);
return ret;
-
-bad_pgd:
- pgd_ERROR(*pgd);
- pgd_clear(pgd);
-no_pgd:
- return 0;
-
-bad_pmd:
- pmd_ERROR(*pmd);
- pmd_clear(pmd);
-no_pmd:
- return 0;
}
static void