summaryrefslogtreecommitdiff
path: root/arch/sparc/prom/printf.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-11-30 22:33:29 (GMT)
committerDavid S. Miller <davem@davemloft.net>2010-11-30 22:33:29 (GMT)
commite62cac1fd035b4cde707285008499dbe71955a86 (patch)
tree214447e9efd4dc49f5bb707c7c1c0073a3df9803 /arch/sparc/prom/printf.c
parent91921fef7c658b12de53376b312d071d757f7770 (diff)
downloadlinux-e62cac1fd035b4cde707285008499dbe71955a86.tar.xz
sparc: Pass buffer pointer all the way down to prom_{get,put}char().
This gets us closer to being able to eliminate the use of dynamic and stack based buffers, so that we can adhere to the "no buffer addresses above 4GB" rule for PROM calls. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/prom/printf.c')
-rw-r--r--arch/sparc/prom/printf.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/sparc/prom/printf.c b/arch/sparc/prom/printf.c
index ca86926..2403197 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++;
}
}