diff options
Diffstat (limited to 'arch/sparc/prom/printf.c')
-rw-r--r-- | arch/sparc/prom/printf.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/sparc/prom/printf.c b/arch/sparc/prom/printf.c index ca869266b9f3..24031971f806 100644 --- a/arch/sparc/prom/printf.c +++ b/arch/sparc/prom/printf.c @@ -23,13 +23,14 @@ static char ppbuf[1024]; void notrace prom_write(const char *buf, unsigned int n) { - char ch; - - while (n != 0) { - --n; - if ((ch = *buf++) == '\n') - prom_putchar('\r'); - prom_putchar(ch); + while (n-- != 0) { + char ch = *buf; + if (ch == '\n') { + char tmp = '\r'; + prom_putchar(&tmp); + } + prom_putchar(buf); + buf++; } } |