diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2017-01-24 09:49:52 +1100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-01-25 13:34:20 +1100 |
commit | dbecd5093043faa9da83c720ed0e08ec1a5b410e (patch) | |
tree | 039459d10db5af8ffe9ac53af29434bf5bd1a365 /arch/powerpc/kernel/rtas.c | |
parent | fb37e12896c1ba0407012fe8cdc0b054da063b6f (diff) | |
download | blackbird-op-linux-dbecd5093043faa9da83c720ed0e08ec1a5b410e.tar.gz blackbird-op-linux-dbecd5093043faa9da83c720ed0e08ec1a5b410e.zip |
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.c | 33 |
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) void __init rtas_initialize(void) { unsigned long rtas_region = RTAS_INSTANTIATE_MAX; + const __be32 *basep, *entryp, *sizep; /* Get RTAS dev node and fill up our "rtas" structure with infos * about it. */ rtas.dev = of_find_node_by_name(NULL, "rtas"); - if (rtas.dev) { - const __be32 *basep, *entryp, *sizep; - - basep = of_get_property(rtas.dev, "linux,rtas-base", NULL); - sizep = of_get_property(rtas.dev, "rtas-size", NULL); - if (basep != NULL && sizep != NULL) { - rtas.base = __be32_to_cpu(*basep); - rtas.size = __be32_to_cpu(*sizep); - entryp = of_get_property(rtas.dev, - "linux,rtas-entry", NULL); - if (entryp == NULL) /* Ugh */ - rtas.entry = rtas.base; - else - rtas.entry = __be32_to_cpu(*entryp); - } else - rtas.dev = NULL; - } if (!rtas.dev) return; + basep = of_get_property(rtas.dev, "linux,rtas-base", NULL); + sizep = of_get_property(rtas.dev, "rtas-size", NULL); + if (basep == NULL || sizep == NULL) { + rtas.dev = NULL; + return; + } + + rtas.base = __be32_to_cpu(*basep); + rtas.size = __be32_to_cpu(*sizep); + entryp = of_get_property(rtas.dev, "linux,rtas-entry", NULL); + if (entryp == NULL) /* Ugh */ + rtas.entry = rtas.base; + else + rtas.entry = __be32_to_cpu(*entryp); + /* If RTAS was found, allocate the RMO buffer for it and look for * the stop-self token if any */ |