powerpc/mm: Unindent htab_dt_scan_page_sizes()

We can unindent the bulk of htab_dt_scan_page_sizes() by returning early
if the property is not found. That is nice in and of itself, but also
has the advantage of making it clear that we always return success once
we have found the ibm,segment-page-sizes property.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Michael Ellerman 2014-08-07 17:26:33 +10:00
parent 87d99c0e2c
commit 9e34992a62

View file

@ -334,7 +334,9 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
return 0; return 0;
prop = of_get_flat_dt_prop(node, "ibm,segment-page-sizes", &size); prop = of_get_flat_dt_prop(node, "ibm,segment-page-sizes", &size);
if (prop != NULL) { if (!prop)
return 0;
pr_info("Page sizes from device-tree:\n"); pr_info("Page sizes from device-tree:\n");
size /= 4; size /= 4;
cur_cpu_spec->mmu_features &= ~(MMU_FTR_16M_PAGE); cur_cpu_spec->mmu_features &= ~(MMU_FTR_16M_PAGE);
@ -348,9 +350,7 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
size -= 3; prop += 3; size -= 3; prop += 3;
base_idx = get_idx_from_shift(base_shift); base_idx = get_idx_from_shift(base_shift);
if (base_idx < 0) { if (base_idx < 0) {
/* /* skip the pte encoding also */
* skip the pte encoding also
*/
prop += lpnum * 2; size -= lpnum * 2; prop += lpnum * 2; size -= lpnum * 2;
continue; continue;
} }
@ -395,9 +395,8 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
def->avpnm, def->tlbiel, def->penc[idx]); def->avpnm, def->tlbiel, def->penc[idx]);
} }
} }
return 1; return 1;
}
return 0;
} }
#ifdef CONFIG_HUGETLB_PAGE #ifdef CONFIG_HUGETLB_PAGE