]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/tidspbridge/core/tiomap3430.c
staging: tidspbridge: add pud code
[~andy/linux] / drivers / staging / tidspbridge / core / tiomap3430.c
index 9cf29fcea11e58700c8010e7249fec7516042190..f9609ce2c163bf55b9a6e78bf64a4fa26f69968e 100644 (file)
@@ -1547,20 +1547,27 @@ EXIT_LOOP:
 static u32 user_va2_pa(struct mm_struct *mm, u32 address)
 {
        pgd_t *pgd;
+       pud_t *pud;
        pmd_t *pmd;
        pte_t *ptep, pte;
 
        pgd = pgd_offset(mm, address);
-       if (!(pgd_none(*pgd) || pgd_bad(*pgd))) {
-               pmd = pmd_offset(pgd, address);
-               if (!(pmd_none(*pmd) || pmd_bad(*pmd))) {
-                       ptep = pte_offset_map(pmd, address);
-                       if (ptep) {
-                               pte = *ptep;
-                               if (pte_present(pte))
-                                       return pte & PAGE_MASK;
-                       }
-               }
+       if (pgd_none(*pgd) || pgd_bad(*pgd))
+               return 0;
+
+       pud = pud_offset(pgd, address);
+       if (pud_none(*pud) || pud_bad(*pud))
+               return 0;
+
+       pmd = pmd_offset(pud, address);
+       if (pmd_none(*pmd) || pmd_bad(*pmd))
+               return 0;
+
+       ptep = pte_offset_map(pmd, address);
+       if (ptep) {
+               pte = *ptep;
+               if (pte_present(pte))
+                       return pte & PAGE_MASK;
        }
 
        return 0;