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>
This commit is contained in:
Maheedhar Bollapalli 2024-04-25 10:34:02 +05:30
parent d153bcf427
commit 7e288d11a5
3 changed files with 13 additions and 8 deletions

View file

@ -51,8 +51,9 @@ void bl2_el3_plat_prepare_exit(void)
void __dead2 plat_error_handler(int err)
{
while (1)
while (1) {
wfi();
}
}
void bl2_plat_preload_setup(void)

View file

@ -80,9 +80,9 @@ uint32_t plat_ic_get_pending_interrupt_type(void)
#endif
}
if (id == GIC_SPURIOUS_INTERRUPT)
if (id == GIC_SPURIOUS_INTERRUPT) {
return INTR_TYPE_INVAL;
}
return INTR_TYPE_NS;
}
@ -142,8 +142,9 @@ uint32_t plat_interrupt_type_to_line(uint32_t type,
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 plat_ic_get_interrupt_id(unsigned int raw)
{
unsigned int id = (raw & INT_ID_MASK);
if (id == GIC_SPURIOUS_INTERRUPT)
if (id == GIC_SPURIOUS_INTERRUPT) {
id = INTR_ID_UNAVAILABLE;
}
return id;
}

View file

@ -59,10 +59,11 @@ static u_register_t calc_stat_residency(unsigned long long pwrupts,
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 @@ plat_local_state_t plat_get_target_pwr_state(unsigned int lvl,
do {
temp = *st;
st++;
if (temp < target)
if (temp < target) {
target = temp;
}
n--;
} while (n > 0U);