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:
parent
87d99c0e2c
commit
9e34992a62
1 changed files with 59 additions and 60 deletions
|
@ -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,10 +395,9 @@ 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
|
||||
/* Scan for 16G memory blocks that have been set aside for huge pages
|
||||
|
|
Loading…
Reference in a new issue