diff options
Diffstat (limited to 'arch/arm/kernel/early_printk.c')
| -rw-r--r-- | arch/arm/kernel/early_printk.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/arm/kernel/early_printk.c b/arch/arm/kernel/early_printk.c index 43076536965c..03239ca0d5ce 100644 --- a/arch/arm/kernel/early_printk.c +++ b/arch/arm/kernel/early_printk.c @@ -1,26 +1,27 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * linux/arch/arm/kernel/early_printk.c * * Copyright (C) 2009 Sascha Hauer <s.hauer@pengutronix.de> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include <linux/kernel.h> #include <linux/console.h> #include <linux/init.h> +#include <linux/string.h> -extern void printch(int); +extern void printascii(const char *); static void early_write(const char *s, unsigned n) { - while (n-- > 0) { - if (*s == '\n') - printch('\r'); - printch(*s); - s++; + char buf[128]; + while (n) { + unsigned l = min(n, sizeof(buf)-1); + memcpy(buf, s, l); + buf[l] = 0; + s += l; + n -= l; + printascii(buf); } } |
