Commit e2fb2511 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/mm: flatten function __find_linux_pte() step 2

__find_linux_pte() is full of if/else which is hard to
follow allthough the handling is pretty simple.

Previous patch left { } blocks. This patch removes the first one
by shifting its content to the left.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent fab9a116
...@@ -369,7 +369,6 @@ pte_t *__find_linux_pte(pgd_t *pgdir, unsigned long ea, ...@@ -369,7 +369,6 @@ pte_t *__find_linux_pte(pgd_t *pgdir, unsigned long ea,
hpdp = (hugepd_t *)&pud; hpdp = (hugepd_t *)&pud;
goto out_huge; goto out_huge;
} }
{
pdshift = PMD_SHIFT; pdshift = PMD_SHIFT;
pmdp = pmd_offset(&pud, ea); pmdp = pmd_offset(&pud, ea);
pmd = READ_ONCE(*pmdp); pmd = READ_ONCE(*pmdp);
...@@ -383,7 +382,7 @@ pte_t *__find_linux_pte(pgd_t *pgdir, unsigned long ea, ...@@ -383,7 +382,7 @@ pte_t *__find_linux_pte(pgd_t *pgdir, unsigned long ea,
if (pmd_trans_huge(pmd) || pmd_devmap(pmd)) { if (pmd_trans_huge(pmd) || pmd_devmap(pmd)) {
if (is_thp) if (is_thp)
*is_thp = true; *is_thp = true;
ret_pte = (pte_t *) pmdp; ret_pte = (pte_t *)pmdp;
goto out; goto out;
} }
/* /*
...@@ -392,7 +391,7 @@ pte_t *__find_linux_pte(pgd_t *pgdir, unsigned long ea, ...@@ -392,7 +391,7 @@ pte_t *__find_linux_pte(pgd_t *pgdir, unsigned long ea,
* dependent. * dependent.
*/ */
if (pmd_huge(pmd) || pmd_large(pmd)) { if (pmd_huge(pmd) || pmd_large(pmd)) {
ret_pte = (pte_t *) pmdp; ret_pte = (pte_t *)pmdp;
goto out; goto out;
} }
if (is_hugepd(__hugepd(pmd_val(pmd)))) { if (is_hugepd(__hugepd(pmd_val(pmd)))) {
...@@ -402,7 +401,6 @@ pte_t *__find_linux_pte(pgd_t *pgdir, unsigned long ea, ...@@ -402,7 +401,6 @@ pte_t *__find_linux_pte(pgd_t *pgdir, unsigned long ea,
return pte_offset_kernel(&pmd, ea); return pte_offset_kernel(&pmd, ea);
} }
}
out_huge: out_huge:
if (!hpdp) if (!hpdp)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment