summaryrefslogtreecommitdiff
path: root/src/console
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-02-14 23:08:29 +0200
committerPatrick Georgi <pgeorgi@google.com>2019-02-27 11:09:31 +0000
commit7132f259bf83f1118893550c0bc914c11081ea84 (patch)
tree1e96bae72bccf6e3d8edc82c36343891fecf07b5 /src/console
parent40f65425e4635de03b6e3114598a5e455fcd6ff8 (diff)
downloadcoreboot-7132f259bf83f1118893550c0bc914c11081ea84.tar.xz
console: Refactor printk() varargs prototypes
Change-Id: I816641c2223c3079ad9c95c1380d4b250898ef93 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/31491 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/console')
-rw-r--r--src/console/printk.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/console/printk.c b/src/console/printk.c
index 735876ee5a..0a9d3bf8ae 100644
--- a/src/console/printk.c
+++ b/src/console/printk.c
@@ -39,9 +39,8 @@ static void wrap_putchar(unsigned char byte, void *data)
do_putchar(byte);
}
-int do_printk(int msg_level, const char *fmt, ...)
+int vprintk(int msg_level, const char *fmt, va_list args)
{
- va_list args;
int i;
if (IS_ENABLED(CONFIG_SQUELCH_EARLY_SMP) && ENV_CACHE_AS_RAM &&
@@ -60,9 +59,7 @@ int do_printk(int msg_level, const char *fmt, ...)
spin_lock(&console_lock);
#endif
- va_start(args, fmt);
i = vtxprintf(wrap_putchar, fmt, args, NULL);
- va_end(args);
console_tx_flush();
@@ -78,12 +75,14 @@ int do_printk(int msg_level, const char *fmt, ...)
return i;
}
-#if IS_ENABLED(CONFIG_VBOOT)
-void do_printk_va_list(int msg_level, const char *fmt, va_list args)
+int do_printk(int msg_level, const char *fmt, ...)
{
- if (!console_log_level(msg_level))
- return;
- vtxprintf(wrap_putchar, fmt, args, NULL);
- console_tx_flush();
+ va_list args;
+ int i;
+
+ va_start(args, fmt);
+ i = vprintk(msg_level, fmt, args);
+ va_end(args);
+
+ return i;
}
-#endif /* CONFIG_VBOOT */