diff options
author | Deepika Bhavnani <deepika.bhavnani@arm.com> | 2019-08-27 00:32:24 +0300 |
---|---|---|
committer | Deepika Bhavnani <deepika.bhavnani@arm.com> | 2019-09-13 01:30:03 +0300 |
commit | fc81021aedf01a922686bc9fa22de411ec80592b (patch) | |
tree | ed06b974d7bf61e1d52b56a70e9f4b305d0965a0 /lib/psci/psci_private.h | |
parent | 5dbdf8e4eac1d5999f07976f9f430894b0784907 (diff) |
Unify type of "cpu_idx" across PSCI module.
cpu_idx is used as mix of `unsigned int` and `signed int` in code
with typecasting at some places. This change is to unify the
cpu_idx as `unsigned int` as underlying API;s `plat_my_core_pos`
returns `unsigned int`
It was discovered via coverity issue CID 354715
Signed-off-by: Deepika Bhavnani <deepika.bhavnani@arm.com>
Change-Id: I4f0adb0c596ff1177210c5fe803bff853f2e54ce
Diffstat (limited to 'lib/psci/psci_private.h')
-rw-r--r-- | lib/psci/psci_private.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/psci/psci_private.h b/lib/psci/psci_private.h index bbcc5cfe..b49847c9 100644 --- a/lib/psci/psci_private.h +++ b/lib/psci/psci_private.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -55,16 +55,16 @@ static inline aff_info_state_t psci_get_aff_info_state(void) return get_cpu_data(psci_svc_cpu_data.aff_info_state); } -static inline aff_info_state_t psci_get_aff_info_state_by_idx(int idx) +static inline aff_info_state_t psci_get_aff_info_state_by_idx(unsigned int idx) { - return get_cpu_data_by_index((unsigned int)idx, + return get_cpu_data_by_index(idx, psci_svc_cpu_data.aff_info_state); } -static inline void psci_set_aff_info_state_by_idx(int idx, +static inline void psci_set_aff_info_state_by_idx(unsigned int idx, aff_info_state_t aff_state) { - set_cpu_data_by_index((unsigned int)idx, + set_cpu_data_by_index(idx, psci_svc_cpu_data.aff_info_state, aff_state); } @@ -88,9 +88,10 @@ static inline plat_local_state_t psci_get_cpu_local_state(void) return get_cpu_data(psci_svc_cpu_data.local_state); } -static inline plat_local_state_t psci_get_cpu_local_state_by_idx(int idx) +static inline plat_local_state_t psci_get_cpu_local_state_by_idx( + unsigned int idx) { - return get_cpu_data_by_index((unsigned int)idx, + return get_cpu_data_by_index(idx, psci_svc_cpu_data.local_state); } @@ -113,7 +114,7 @@ typedef struct non_cpu_pwr_domain_node { * Index of the first CPU power domain node level 0 which has this node * as its parent. */ - int cpu_start_idx; + unsigned int cpu_start_idx; /* * Number of CPU power domains which are siblings of the domain indexed @@ -269,7 +270,7 @@ void psci_get_target_local_pwr_states(unsigned int end_pwrlvl, psci_power_state_t *target_state); int psci_validate_entry_point(entry_point_info_t *ep, uintptr_t entrypoint, u_register_t context_id); -void psci_get_parent_pwr_domain_nodes(int cpu_idx, +void psci_get_parent_pwr_domain_nodes(unsigned int cpu_idx, unsigned int end_lvl, unsigned int *node_index); void psci_do_state_coordination(unsigned int end_pwrlvl, |