Frans Hendriks has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/49960 )
Change subject: console: Correct code style ......................................................................
console: Correct code style
lint report errors and warnings
Solve the next issues: - BRACES - LONG_LINE_STRING - POINTER_LOCATION - SWITCH_CASE_INDENT_LEVEL - TRAILING_STATEMENTS
BUG = N/A TEST = Build Compulab Intense-PC with secure oprom enabled
Change-Id: Ibb200bf7dd1ef7632aa4e1213bce72d9165560c9 Signed-off-by: Frans Hendriks fhendriks@eltan.com --- M src/console/printk.c M src/console/vtxprintf.c 2 files changed, 23 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/49960/1
diff --git a/src/console/printk.c b/src/console/printk.c index 85d9bfb..a64af97 100644 --- a/src/console/printk.c +++ b/src/console/printk.c @@ -38,8 +38,8 @@ if (!TRACK_CONSOLE_TIME) return;
- printk(BIOS_DEBUG, "BS: " ENV_STRING " times (exec / console): total (unknown) / %ld ms\n", - DIV_ROUND_CLOSEST(console_usecs, USECS_PER_MSEC)); + printk(BIOS_DEBUG, "BS: " ENV_STRING " times (exec / console): total (unknown) / " + "%ld ms\n", DIV_ROUND_CLOSEST(console_usecs, USECS_PER_MSEC)); }
long console_time_get_and_reset(void) diff --git a/src/console/vtxprintf.c b/src/console/vtxprintf.c index c7bb585..131c47f 100644 --- a/src/console/vtxprintf.c +++ b/src/console/vtxprintf.c @@ -64,17 +64,17 @@ num /= base; } } - if (i > precision) { + if (i > precision) precision = i; - } + size -= precision; if (!(type&(ZEROPAD+LEFT))) { while (size-- > 0) call_tx(' '), count++; } - if (sign) { + if (sign) call_tx(sign), count++; - } + if (type & SPECIAL) { if (base == 8) call_tx('0'), count++; @@ -127,12 +127,22 @@ repeat: ++fmt; /* this also skips first '%' */ switch (*fmt) { - case '-': flags |= LEFT; goto repeat; - case '+': flags |= PLUS; goto repeat; - case ' ': flags |= SPACE; goto repeat; - case '#': flags |= SPECIAL; goto repeat; - case '0': flags |= ZEROPAD; goto repeat; - } + case '-': + flags |= LEFT; + goto repeat; + case '+': + flags |= PLUS; + goto repeat; + case ' ': + flags |= SPACE; + goto repeat; + case '#': + flags |= SPECIAL; + goto repeat; + case '0': + flags |= ZEROPAD; + goto repeat; + }
/* get field width */ field_width = -1; @@ -159,9 +169,8 @@ /* it's the next argument */ precision = va_arg(args, int); } - if (precision < 0) { + if (precision < 0) precision = 0; - } }
/* get the conversion qualifier */