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_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) ?