Commit 814dce8f authored by Samuel Holland's avatar Samuel Holland
Browse files

allwinner: psci: Invert check in .validate_ns_entrypoint



Checking the exceptional case and letting the success case fall through
is not only more idiomatic, but it also allows adding more exceptional
cases in the future, such as a check for overlapping secure DRAM.

Change-Id: I720441a6a8853fd7f211ebe851f14d921a6db03d
Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
parent 772ef7e7
/*
* Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
......@@ -207,10 +207,11 @@ static int sunxi_validate_power_state(unsigned int power_state,
static int sunxi_validate_ns_entrypoint(uintptr_t ns_entrypoint)
{
/* The non-secure entry point must be in DRAM */
if (ns_entrypoint >= SUNXI_DRAM_BASE)
return PSCI_E_SUCCESS;
if (ns_entrypoint < SUNXI_DRAM_BASE) {
return PSCI_E_INVALID_ADDRESS;
}
return PSCI_E_INVALID_ADDRESS;
return PSCI_E_SUCCESS;
}
static void sunxi_get_sys_suspend_power_state(psci_power_state_t *req_state)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment