Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+60 −61
Original line number Diff line number Diff line
@@ -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