Commit 500c0eda authored by davidcunado-arm's avatar davidcunado-arm Committed by GitHub
Browse files

Merge pull request #981 from soby-mathew/sm/cov_scmi

Fix coverity error in CSS SCMI driver
parents b4ebf545 b78c402d
...@@ -189,7 +189,7 @@ void css_scp_off(const psci_power_state_t *target_state) ...@@ -189,7 +189,7 @@ void css_scp_off(const psci_power_state_t *target_state)
*/ */
void css_scp_on(u_register_t mpidr) void css_scp_on(u_register_t mpidr)
{ {
int lvl = 0, ret; int lvl = 0, ret, core_pos;
uint32_t scmi_pwr_state = 0; uint32_t scmi_pwr_state = 0;
for (; lvl <= PLAT_MAX_PWR_LVL; lvl++) for (; lvl <= PLAT_MAX_PWR_LVL; lvl++)
...@@ -198,8 +198,11 @@ void css_scp_on(u_register_t mpidr) ...@@ -198,8 +198,11 @@ void css_scp_on(u_register_t mpidr)
SCMI_SET_PWR_STATE_MAX_PWR_LVL(scmi_pwr_state, lvl - 1); SCMI_SET_PWR_STATE_MAX_PWR_LVL(scmi_pwr_state, lvl - 1);
core_pos = plat_core_pos_by_mpidr(mpidr);
assert(core_pos >= 0 && core_pos < PLATFORM_CORE_COUNT);
ret = scmi_pwr_state_set(scmi_handle, ret = scmi_pwr_state_set(scmi_handle,
plat_css_core_pos_to_scmi_dmn_id_map[plat_core_pos_by_mpidr(mpidr)], plat_css_core_pos_to_scmi_dmn_id_map[core_pos],
scmi_pwr_state); scmi_pwr_state);
if (ret != SCMI_E_QUEUED && ret != SCMI_E_SUCCESS) { if (ret != SCMI_E_QUEUED && ret != SCMI_E_SUCCESS) {
......
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