mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-08 13:53:54 +00:00
fix(console): 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: If8e77b291380fa7d9d95cab5836235790404b620 Signed-off-by: Nithin G <nithing@amd.com> Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
This commit is contained in:
parent
03c6bb0e38
commit
9ded5e8d8b
1 changed files with 17 additions and 9 deletions
|
@ -22,8 +22,9 @@ int console_register(console_t *console)
|
||||||
assert((console < stacks_start) || (console >= stacks_end));
|
assert((console < stacks_start) || (console >= stacks_end));
|
||||||
|
|
||||||
/* Check that we won't make a circle in the list. */
|
/* Check that we won't make a circle in the list. */
|
||||||
if (console_is_registered(console) == 1)
|
if (console_is_registered(console) == 1) {
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
console->next = console_list;
|
console->next = console_list;
|
||||||
console_list = console;
|
console_list = console;
|
||||||
|
@ -53,9 +54,11 @@ int console_is_registered(console_t *to_find)
|
||||||
|
|
||||||
assert(to_find != NULL);
|
assert(to_find != NULL);
|
||||||
|
|
||||||
for (console = console_list; console != NULL; console = console->next)
|
for (console = console_list; console != NULL; console = console->next) {
|
||||||
if (console == to_find)
|
if (console == to_find) {
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -91,21 +94,24 @@ int console_putc(int c)
|
||||||
int err = ERROR_NO_VALID_CONSOLE;
|
int err = ERROR_NO_VALID_CONSOLE;
|
||||||
console_t *console;
|
console_t *console;
|
||||||
|
|
||||||
for (console = console_list; console != NULL; console = console->next)
|
for (console = console_list; console != NULL; console = console->next) {
|
||||||
if ((console->flags & console_state) && (console->putc != NULL)) {
|
if ((console->flags & console_state) && (console->putc != NULL)) {
|
||||||
int ret = do_putc(c, console);
|
int ret = do_putc(c, console);
|
||||||
if ((err == ERROR_NO_VALID_CONSOLE) || (ret < err))
|
if ((err == ERROR_NO_VALID_CONSOLE) || (ret < err)) {
|
||||||
err = ret;
|
err = ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int putchar(int c)
|
int putchar(int c)
|
||||||
{
|
{
|
||||||
if (console_putc(c) == 0)
|
if (console_putc(c) == 0) {
|
||||||
return c;
|
return c;
|
||||||
else
|
} else {
|
||||||
return EOF;
|
return EOF;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_CONSOLE_GETC
|
#if ENABLE_CONSOLE_GETC
|
||||||
|
@ -119,10 +125,12 @@ int console_getc(void)
|
||||||
console = console->next)
|
console = console->next)
|
||||||
if ((console->flags & console_state) && (console->getc != NULL)) {
|
if ((console->flags & console_state) && (console->getc != NULL)) {
|
||||||
int ret = console->getc(console);
|
int ret = console->getc(console);
|
||||||
if (ret >= 0)
|
if (ret >= 0) {
|
||||||
return ret;
|
return ret;
|
||||||
if (err != ERROR_NO_PENDING_CHAR)
|
}
|
||||||
|
if (err != ERROR_NO_PENDING_CHAR) {
|
||||||
err = ret;
|
err = ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} while (err == ERROR_NO_PENDING_CHAR);
|
} while (err == ERROR_NO_PENDING_CHAR);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue