diff options
author | Soby Mathew <soby.mathew@arm.com> | 2015-07-29 17:05:03 +0100 |
---|---|---|
committer | Achin Gupta <achin.gupta@arm.com> | 2015-08-13 23:48:07 +0100 |
commit | 9d070b9928b874700395ca48780ce2c88b70e588 (patch) | |
tree | b5aa67728ea296bf8d2e39ce15129cc8228816cb /services/std_svc/psci/psci_suspend.c | |
parent | 58523c076a4bd766fccd207c493cf1b918fda9db (diff) |
PSCI: Rework generic code to conform to coding guidelines
This patch reworks the PSCI generic implementation to conform to ARM
Trusted Firmware coding guidelines as described here:
https://github.com/ARM-software/arm-trusted-firmware/wiki
This patch also reviews the use of signed data types within PSCI
Generic code and replaces them with their unsigned counterparts wherever
they are not appropriate. The PSCI_INVALID_DATA macro which was defined
to -1 is now replaced with PSCI_INVALID_PWR_LVL macro which is defined
to PLAT_MAX_PWR_LVL + 1.
Change-Id: Iaea422d0e46fc314e0b173c2b4c16e0d56b2515a
Diffstat (limited to 'services/std_svc/psci/psci_suspend.c')
-rw-r--r-- | services/std_svc/psci/psci_suspend.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/services/std_svc/psci/psci_suspend.c b/services/std_svc/psci/psci_suspend.c index 71e47784..a158e36f 100644 --- a/services/std_svc/psci/psci_suspend.c +++ b/services/std_svc/psci/psci_suspend.c @@ -72,7 +72,7 @@ static void psci_suspend_to_standby_finisher(unsigned int cpu_idx, * This function does generic and platform specific suspend to power down * operations. ******************************************************************************/ -static void psci_suspend_to_pwrdown_start(int end_pwrlvl, +static void psci_suspend_to_pwrdown_start(unsigned int end_pwrlvl, entry_point_info_t *ep, psci_power_state_t *state_info) { @@ -127,7 +127,7 @@ static void psci_suspend_to_pwrdown_start(int end_pwrlvl, * not possible to undo any of the actions taken beyond that point. ******************************************************************************/ void psci_cpu_suspend_start(entry_point_info_t *ep, - int end_pwrlvl, + unsigned int end_pwrlvl, psci_power_state_t *state_info, unsigned int is_power_down_state) { @@ -212,8 +212,8 @@ exit: void psci_cpu_suspend_finish(unsigned int cpu_idx, psci_power_state_t *state_info) { - int32_t suspend_level; - uint64_t counter_freq; + unsigned long long counter_freq; + unsigned int suspend_level; /* Ensure we have been woken up from a suspended state */ assert(psci_get_aff_info_state() == AFF_STATE_ON && is_local_state_off(\ @@ -246,12 +246,12 @@ void psci_cpu_suspend_finish(unsigned int cpu_idx, */ if (psci_spd_pm && psci_spd_pm->svc_suspend) { suspend_level = psci_get_suspend_pwrlvl(); - assert (suspend_level != PSCI_INVALID_DATA); + assert (suspend_level != PSCI_INVALID_PWR_LVL); psci_spd_pm->svc_suspend_finish(suspend_level); } /* Invalidate the suspend level for the cpu */ - psci_set_suspend_pwrlvl(PSCI_INVALID_DATA); + psci_set_suspend_pwrlvl(PSCI_INVALID_PWR_LVL); /* * Generic management: Now we just need to retrieve the |