OSDN Git Service

arm64/kernel: Simplify __cpu_up() by bailing out early
authorGavin Shan <gshan@redhat.com>
Mon, 2 Mar 2020 02:03:40 +0000 (13:03 +1100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 17 Mar 2020 18:31:10 +0000 (18:31 +0000)
commitd22b115cbfbb7e4a938f9eb6ea77da9ecac3df5a
tree2e4ca8ff5ad224435ba01a6ad8490ce93269db58
parent24b2cce91f47d19fcc5a2c4c60dbabbd0e30adf1
arm64/kernel: Simplify __cpu_up() by bailing out early

The function __cpu_up() is invoked to bring up the target CPU through
the backend, PSCI for example. The nested if statements won't be needed
if we bail out early on the following two conditions where the status
won't be checked. The code looks simplified in that case.

   * Error returned from the backend (e.g. PSCI)
   * The target CPU has been marked as onlined

Signed-off-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
arch/arm64/kernel/smp.c