From 5965d01dd0fcce8f9fc7c2b24390bece38c8ea88 Mon Sep 17 00:00:00 2001 From: Omar Ramirez Luna Date: Fri, 29 Jun 2012 13:49:17 -0500 Subject: [PATCH] --- yaml --- r: 317751 b: refs/heads/master c: a454ad15e015526ca84f15460bf8a56fccfffeea h: refs/heads/master i: 317749: 78aaca63458a2865443ff64629aae067a1e482f5 317747: b7864aec70cf9a68594f237d2d059d18f5618b66 317743: f1d8e0826d5a0c15a4f05c268647857c61bd9d5f v: v3 --- [refs] | 2 +- .../staging/tidspbridge/core/tiomap3430.c | 27 ++++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 9ffe26abb285..67c3d07cc925 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0e7e10fe49213ba4e9dc8a74615b81dd8a57ba2a +refs/heads/master: a454ad15e015526ca84f15460bf8a56fccfffeea diff --git a/trunk/drivers/staging/tidspbridge/core/tiomap3430.c b/trunk/drivers/staging/tidspbridge/core/tiomap3430.c index 9cf29fcea11e..f9609ce2c163 100644 --- a/trunk/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/trunk/drivers/staging/tidspbridge/core/tiomap3430.c @@ -1547,20 +1547,27 @@ static int bridge_brd_mem_un_map(struct bridge_dev_context *dev_ctxt, 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;