Patchwork [RFC,2/8] sparc: prom: Use the return value from prom_nbputchar()

login
register
mail settings
Submitter Julian Calaby
Date Dec. 4, 2010, 3:56 a.m.
Message ID <4CF9BBD9.2090403@gmail.com>
Download mbox | patch
Permalink /patch/74242/
State Rejected
Delegated to: David Miller
Headers show

Comments

Julian Calaby - Dec. 4, 2010, 3:56 a.m.
As prom_nbputchar() now returns 1 when it succeeds, use it instead
of decrementing len or incrementing buf - as this matches the
behaviour of prom_console_write_buf() in console_64.c

Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
---
 arch/sparc/prom/console_32.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Dec. 12, 2010, 10:51 p.m.
From: Julian Calaby <julian.calaby@gmail.com>
Date: Sat, 04 Dec 2010 14:56:09 +1100

> As prom_nbputchar() now returns 1 when it succeeds, use it instead
> of decrementing len or incrementing buf - as this matches the
> behaviour of prom_console_write_buf() in console_64.c
> 
> Signed-off-by: Julian Calaby <julian.calaby@gmail.com>

Since we're not doing patch #5 this change no longer makes
any sense.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/sparc/prom/console_32.c b/arch/sparc/prom/console_32.c
index b05e3db..055368a 100644
--- a/arch/sparc/prom/console_32.c
+++ b/arch/sparc/prom/console_32.c
@@ -50,8 +50,7 @@  void prom_console_write_buf(const char *buf, int len)
 		int n = prom_nbputchar(buf);
 		if (n < 0)
 			continue;
-		len--;
-		buf++;
+		len -= n;
+		buf += n;
 	}
 }
-