aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/rtas.c
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2017-01-23 17:49:52 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2017-01-24 21:34:20 -0500
commitdbecd5093043faa9da83c720ed0e08ec1a5b410e (patch)
tree039459d10db5af8ffe9ac53af29434bf5bd1a365 /arch/powerpc/kernel/rtas.c
parentfb37e12896c1ba0407012fe8cdc0b054da063b6f (diff)
powerpc/kernel: Remove nested if statements in rtas_initialize()
This removes the unnecessary nested if statements in function rtas_initialize(), to simplify the code. No functional changes introduced. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/rtas.c')
-rw-r--r--arch/powerpc/kernel/rtas.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 112cc3b2ee1a..9759dcbd055d 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -1145,31 +1145,30 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
1145void __init rtas_initialize(void) 1145void __init rtas_initialize(void)
1146{ 1146{
1147 unsigned long rtas_region = RTAS_INSTANTIATE_MAX; 1147 unsigned long rtas_region = RTAS_INSTANTIATE_MAX;
1148 const __be32 *basep, *entryp, *sizep;
1148 1149
1149 /* Get RTAS dev node and fill up our "rtas" structure with infos 1150 /* Get RTAS dev node and fill up our "rtas" structure with infos
1150 * about it. 1151 * about it.
1151 */ 1152 */
1152 rtas.dev = of_find_node_by_name(NULL, "rtas"); 1153 rtas.dev = of_find_node_by_name(NULL, "rtas");
1153 if (rtas.dev) {
1154 const __be32 *basep, *entryp, *sizep;
1155
1156 basep = of_get_property(rtas.dev, "linux,rtas-base", NULL);
1157 sizep = of_get_property(rtas.dev, "rtas-size", NULL);
1158 if (basep != NULL && sizep != NULL) {
1159 rtas.base = __be32_to_cpu(*basep);
1160 rtas.size = __be32_to_cpu(*sizep);
1161 entryp = of_get_property(rtas.dev,
1162 "linux,rtas-entry", NULL);
1163 if (entryp == NULL) /* Ugh */
1164 rtas.entry = rtas.base;
1165 else
1166 rtas.entry = __be32_to_cpu(*entryp);
1167 } else
1168 rtas.dev = NULL;
1169 }
1170 if (!rtas.dev) 1154 if (!rtas.dev)
1171 return; 1155 return;
1172 1156
1157 basep = of_get_property(rtas.dev, "linux,rtas-base", NULL);
1158 sizep = of_get_property(rtas.dev, "rtas-size", NULL);
1159 if (basep == NULL || sizep == NULL) {
1160 rtas.dev = NULL;
1161 return;
1162 }
1163
1164 rtas.base = __be32_to_cpu(*basep);
1165 rtas.size = __be32_to_cpu(*sizep);
1166 entryp = of_get_property(rtas.dev, "linux,rtas-entry", NULL);
1167 if (entryp == NULL) /* Ugh */
1168 rtas.entry = rtas.base;
1169 else
1170 rtas.entry = __be32_to_cpu(*entryp);
1171
1173 /* If RTAS was found, allocate the RMO buffer for it and look for 1172 /* If RTAS was found, allocate the RMO buffer for it and look for
1174 * the stop-self token if any 1173 * the stop-self token if any
1175 */ 1174 */