From bd7ad5e684aafd12c9c5873e4776c4a14e5e5dc0 Mon Sep 17 00:00:00 2001 From: Maheedhar Bollapalli Date: Thu, 25 Apr 2024 11:54:50 +0530 Subject: [PATCH] fix(locks): 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: Ie33b310f6406d77a7a2ebd94cf54c2a2968f8644 Signed-off-by: Nithin G Signed-off-by: Maheedhar Bollapalli --- lib/locks/bakery/bakery_lock_coherent.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/locks/bakery/bakery_lock_coherent.c b/lib/locks/bakery/bakery_lock_coherent.c index bcd89ef8a..2617fdfa6 100644 --- a/lib/locks/bakery/bakery_lock_coherent.c +++ b/lib/locks/bakery/bakery_lock_coherent.c @@ -63,8 +63,9 @@ static unsigned int bakery_get_ticket(bakery_lock_t *bakery, unsigned int me) bakery->lock_data[me] = make_bakery_data(CHOOSING_TICKET, my_ticket); for (they = 0U; they < BAKERY_LOCK_MAX_CPUS; they++) { their_ticket = bakery_ticket_number(bakery->lock_data[they]); - if (their_ticket > my_ticket) + if (their_ticket > my_ticket) { my_ticket = their_ticket; + } } /* @@ -108,8 +109,9 @@ void bakery_lock_get(bakery_lock_t *bakery) */ my_prio = bakery_get_priority(my_ticket, me); for (they = 0U; they < BAKERY_LOCK_MAX_CPUS; they++) { - if (me == they) + if (me == they) { continue; + } /* Wait for the contender to get their ticket */ do {