Skip to content

Commit

Permalink
libsel4platsupport: use switch/case
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Heider <axelheider@gmx.de>
  • Loading branch information
axel-h committed Apr 4, 2024
1 parent 335cece commit f56797b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libsel4platsupport/src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,17 @@ int platsupport_serial_setup_simple(
vka_t *_vka __attribute__((unused)))
{
int err = 0;
if (setup_status == SETUP_COMPLETE) {
switch (setup_status) {
case SETUP_COMPLETE:
return 0;
}
if (setup_status != NOT_INITIALIZED) {
case NOT_INITIALIZED:
break; /* continue below */
default:
ZF_LOGE("Trying to initialise a partially initialised serial. Current setup status is %d\n", setup_status);
assert(!"You cannot recover");
return -1;
}

#ifdef USE_DEBUG_PUTCHAR
/* only support putchar on a debug kernel */
setup_status = SETUP_COMPLETE;
Expand Down

0 comments on commit f56797b

Please sign in to comment.