Commit 9e34992a authored by Michael Ellerman's avatar Michael Ellerman

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: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 87d99c0e
......@@ -334,7 +334,9 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
return 0;
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");
size /= 4;
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;
base_idx = get_idx_from_shift(base_shift);
if (base_idx < 0) {
/*
* skip the pte encoding also
*/
/* skip the pte encoding also */
prop += lpnum * 2; size -= lpnum * 2;
continue;
}
......@@ -395,9 +395,8 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
def->avpnm, def->tlbiel, def->penc[idx]);
}
}
return 1;
}
return 0;
}
#ifdef CONFIG_HUGETLB_PAGE
......
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