aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Ramirez Luna <omar.ramirez@copitl.com>2012-06-29 14:49:17 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-06 19:17:01 -0400
commita454ad15e015526ca84f15460bf8a56fccfffeea (patch)
tree44aa1f9318f39c33f29635cddc61b273af8e7cf5
parent0e7e10fe49213ba4e9dc8a74615b81dd8a57ba2a (diff)
staging: tidspbridge: add pud code
And fix the following warning for passing an incorrect variable type. ../tiomap3430.c: In function 'user_va2_pa': ../tiomap3430.c:1555: warning: passing argument 1 of 'pmd_offset' from incompatible pointer type arch/arm/include/asm/pgtable-2level.h:156: note: expected 'struct pud_t *' but argument is of type 'pmdval_t (*)[2]' While at it, eliminate 'if' nesting to increase readability. Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/tidspbridge/core/tiomap3430.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c
index 9cf29fcea11..f9609ce2c16 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -1547,20 +1547,27 @@ EXIT_LOOP:
1547static u32 user_va2_pa(struct mm_struct *mm, u32 address) 1547static u32 user_va2_pa(struct mm_struct *mm, u32 address)
1548{ 1548{
1549 pgd_t *pgd; 1549 pgd_t *pgd;
1550 pud_t *pud;
1550 pmd_t *pmd; 1551 pmd_t *pmd;
1551 pte_t *ptep, pte; 1552 pte_t *ptep, pte;
1552 1553
1553 pgd = pgd_offset(mm, address); 1554 pgd = pgd_offset(mm, address);
1554 if (!(pgd_none(*pgd) || pgd_bad(*pgd))) { 1555 if (pgd_none(*pgd) || pgd_bad(*pgd))
1555 pmd = pmd_offset(pgd, address); 1556 return 0;
1556 if (!(pmd_none(*pmd) || pmd_bad(*pmd))) { 1557
1557 ptep = pte_offset_map(pmd, address); 1558 pud = pud_offset(pgd, address);
1558 if (ptep) { 1559 if (pud_none(*pud) || pud_bad(*pud))
1559 pte = *ptep; 1560 return 0;
1560 if (pte_present(pte)) 1561
1561 return pte & PAGE_MASK; 1562 pmd = pmd_offset(pud, address);
1562 } 1563 if (pmd_none(*pmd) || pmd_bad(*pmd))
1563 } 1564 return 0;
1565
1566 ptep = pte_offset_map(pmd, address);
1567 if (ptep) {
1568 pte = *ptep;
1569 if (pte_present(pte))
1570 return pte & PAGE_MASK;
1564 } 1571 }
1565 1572
1566 return 0; 1573 return 0;