summaryrefslogtreecommitdiff
path: root/kernel/printk
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-12-10 15:45:53 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 17:41:10 -0800
commit1dc6244bd6d4f62239487fb0befc41c63e117290 (patch)
treee4297d59fc7ee4130059ad082ac7cf206195d408 /kernel/printk
parent9e3961a0979817c612b10b2da4f3045ec9faa779 (diff)
printk: remove used-once early_vprintk
Eliminate the unlikely possibility of message interleaving for early_printk/early_vprintk use. early_vprintk can be done via the %pV extension so remove this unnecessary function and change early_printk to have the equivalent vprintk code. All uses of early_printk already end with a newline so also remove the unnecessary newline from the early_printk function. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/printk')
-rw-r--r--kernel/printk/printk.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index ced2b84b1cb7..4815c98ae175 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1881,23 +1881,20 @@ static size_t cont_print_text(char *text, size_t size) { return 0; }
#ifdef CONFIG_EARLY_PRINTK
struct console *early_console;
-void early_vprintk(const char *fmt, va_list ap)
-{
- if (early_console) {
- char buf[512];
- int n = vscnprintf(buf, sizeof(buf), fmt, ap);
-
- early_console->write(early_console, buf, n);
- }
-}
-
asmlinkage __visible void early_printk(const char *fmt, ...)
{
va_list ap;
+ char buf[512];
+ int n;
+
+ if (!early_console)
+ return;
va_start(ap, fmt);
- early_vprintk(fmt, ap);
+ n = vscnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
+
+ early_console->write(early_console, buf, n);
}
#endif