fix(psci): add missing curly braces
This corrects the MISRA violation C2012-15.6:
The body of an iteration-statement or a selection-statement
shall be a compound-statement.Enclosed statement body within
the curly braces.
Change-Id: Ibd402a52e44e59d1c37613d8925aac8e115aa31c
Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Signed-off-by: Saivardhan Thatikonda <saivardhan.thatikonda@amd.com>
diff --git a/lib/psci/psci_main.c b/lib/psci/psci_main.c
index 00b0003..308c6f9 100644
--- a/lib/psci/psci_main.c
+++ b/lib/psci/psci_main.c
@@ -331,8 +331,9 @@
* psci_spd_migrate_info() returns.
*/
rc = psci_spd_migrate_info(&resident_cpu_mpidr);
- if ((rc != PSCI_TOS_NOT_UP_MIG_CAP) && (rc != PSCI_TOS_UP_MIG_CAP))
+ if ((rc != PSCI_TOS_NOT_UP_MIG_CAP) && (rc != PSCI_TOS_UP_MIG_CAP)) {
return (u_register_t)(register_t) PSCI_E_INVALID_PARAMS;
+ }
return resident_cpu_mpidr;
}
@@ -343,12 +344,14 @@
int rc;
/* Validate target_cpu */
- if (!is_valid_mpidr(target_cpu))
+ if (!is_valid_mpidr(target_cpu)) {
return PSCI_E_INVALID_PARAMS;
+ }
/* Validate power_level against PLAT_MAX_PWR_LVL */
- if (power_level > PLAT_MAX_PWR_LVL)
+ if (power_level > PLAT_MAX_PWR_LVL) {
return PSCI_E_INVALID_PARAMS;
+ }
/*
* Dispatch this call to platform to query power controller, and pass on
diff --git a/lib/psci/psci_mem_protect.c b/lib/psci/psci_mem_protect.c
index 385dcd2..68ad705 100644
--- a/lib/psci/psci_mem_protect.c
+++ b/lib/psci/psci_mem_protect.c
@@ -18,10 +18,12 @@
assert(psci_plat_pm_ops->read_mem_protect != NULL);
assert(psci_plat_pm_ops->write_mem_protect != NULL);
- if (psci_plat_pm_ops->read_mem_protect(&val) < 0)
+ if (psci_plat_pm_ops->read_mem_protect(&val) < 0) {
return (u_register_t) PSCI_E_NOT_SUPPORTED;
- if (psci_plat_pm_ops->write_mem_protect(enable) < 0)
+ }
+ if (psci_plat_pm_ops->write_mem_protect(enable) < 0) {
return (u_register_t) PSCI_E_NOT_SUPPORTED;
+ }
return (val != 0) ? 1U : 0U;
}
@@ -32,8 +34,9 @@
assert(psci_plat_pm_ops->mem_protect_chk != NULL);
- if ((length == 0U) || check_uptr_overflow(base, length - 1U))
+ if ((length == 0U) || check_uptr_overflow(base, length - 1U)) {
return (u_register_t) PSCI_E_DENIED;
+ }
ret = psci_plat_pm_ops->mem_protect_chk(base, length);
return (ret < 0) ?