[RFC 6/8] powerpc/prom: Simplify the logic while fetching SLB size
Anshuman Khandual
khandual at linux.vnet.ibm.com
Tue Jul 21 16:58:44 AEST 2015
From: "khandual at linux.vnet.ibm.com" <khandual at linux.vnet.ibm.com>
This patch just simplifies the existing code logic while fetching
the SLB size property from the device tree.
Signed-off-by: Anshuman Khandual <khandual at linux.vnet.ibm.com>
---
arch/powerpc/kernel/prom.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 8b888b1..f6168e2 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -223,14 +223,12 @@ static void __init check_cpu_slb_size(unsigned long node)
const __be32 *slb_size_ptr;
slb_size_ptr = of_get_flat_dt_prop(node, "slb-size", NULL);
- if (slb_size_ptr != NULL) {
- mmu_slb_size = be32_to_cpup(slb_size_ptr);
- return;
- }
- slb_size_ptr = of_get_flat_dt_prop(node, "ibm,slb-size", NULL);
- if (slb_size_ptr != NULL) {
- mmu_slb_size = be32_to_cpup(slb_size_ptr);
+ if (!slb_size_ptr) {
+ slb_size_ptr = of_get_flat_dt_prop(node, "ibm,slb-size", NULL);
+ if (!slb_size_ptr)
+ return;
}
+ mmu_slb_size = be32_to_cpup(slb_size_ptr);
}
#else
#define check_cpu_slb_size(node) do { } while(0)
--
2.1.0
More information about the Linuxppc-dev
mailing list