fix(platforms): 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: I1327a206782ccd341c0c7eaa3f26078150458ed0
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
diff --git a/plat/common/plat_bl_common.c b/plat/common/plat_bl_common.c
index dbb6f81..4772bad 100644
--- a/plat/common/plat_bl_common.c
+++ b/plat/common/plat_bl_common.c
@@ -51,8 +51,9 @@
void __dead2 plat_error_handler(int err)
{
- while (1)
+ while (1) {
wfi();
+ }
}
void bl2_plat_preload_setup(void)
diff --git a/plat/common/plat_gicv2.c b/plat/common/plat_gicv2.c
index f78d2df..05df97a 100644
--- a/plat/common/plat_gicv2.c
+++ b/plat/common/plat_gicv2.c
@@ -80,9 +80,9 @@
#endif
}
- if (id == GIC_SPURIOUS_INTERRUPT)
+ if (id == GIC_SPURIOUS_INTERRUPT) {
return INTR_TYPE_INVAL;
-
+ }
return INTR_TYPE_NS;
}
@@ -142,8 +142,9 @@
assert(sec_state_is_valid(security_state));
/* Non-secure interrupts are signaled on the IRQ line always */
- if (type == INTR_TYPE_NS)
+ if (type == INTR_TYPE_NS) {
return __builtin_ctz(SCR_IRQ_BIT);
+ }
/*
* Secure interrupts are signaled using the IRQ line if the FIQ is
@@ -329,8 +330,9 @@
{
unsigned int id = (raw & INT_ID_MASK);
- if (id == GIC_SPURIOUS_INTERRUPT)
+ if (id == GIC_SPURIOUS_INTERRUPT) {
id = INTR_ID_UNAVAILABLE;
+ }
return id;
}
diff --git a/plat/common/plat_psci_common.c b/plat/common/plat_psci_common.c
index 4cea0b9..72b79ad 100644
--- a/plat/common/plat_psci_common.c
+++ b/plat/common/plat_psci_common.c
@@ -59,10 +59,11 @@
residency_div = read_cntfrq_el0() / MHZ_TICKS_PER_SEC;
assert(residency_div > 0U);
- if (pwrupts < pwrdnts)
+ if (pwrupts < pwrdnts) {
res = MAX_TS - pwrdnts + pwrupts;
- else
+ } else {
res = pwrupts - pwrdnts;
+ }
return res / residency_div;
}
@@ -170,8 +171,9 @@
do {
temp = *st;
st++;
- if (temp < target)
+ if (temp < target) {
target = temp;
+ }
n--;
} while (n > 0U);