All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julian Calaby <julian.calaby@gmail.com>
To: sparclinux@vger.kernel.org
Subject: [RFC 1/8] sparc: prom: Sanitize return value from prom_nbputchar()
Date: Sat, 04 Dec 2010 03:56:45 +0000	[thread overview]
Message-ID: <4CF9BBFD.70503@gmail.com> (raw)
In-Reply-To: <4CF9BBC6.3080809@julian.is-a-geek.org>

Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
---

Sorry about the dupe, wrong from address.

 arch/sparc/prom/console_32.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/sparc/prom/console_32.c b/arch/sparc/prom/console_32.c
index 4886310..b05e3db 100644
--- a/arch/sparc/prom/console_32.c
+++ b/arch/sparc/prom/console_32.c
@@ -27,13 +27,14 @@ static int prom_nbputchar(const char *buf)
 	spin_lock_irqsave(&prom_lock, flags);
 	switch(prom_vers) {
 	case PROM_V0:
-		i = (*(romvec->pv_nbputchar))(*buf);
+		if ((*(romvec->pv_nbputchar))(*buf))
+			i = 1;
 		break;
 	case PROM_V2:
 	case PROM_V3:
 		if ((*(romvec->pv_v2devops).v2_dev_write)(*romvec->pv_v2bootargs.fd_stdout,
 							  buf, 0x1) = 1)
-			i = 0;
+			i = 1;
 		break;
 	default:
 		break;
@@ -47,7 +48,7 @@ void prom_console_write_buf(const char *buf, int len)
 {
 	while (len) {
 		int n = prom_nbputchar(buf);
-		if (n)
+		if (n < 0)
 			continue;
 		len--;
 		buf++;

  reply	other threads:[~2010-12-04  3:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-04  3:55 [RFC 1/8] sparc: prom: Sanitize return value from prom_nbputchar() Julian Calaby
2010-12-04  3:56 ` Julian Calaby [this message]
2010-12-12 22:51 ` [RFC 1/8] sparc: prom: Sanitize return value from David Miller
2011-01-04 14:42 ` [RFC 1/8] sparc: prom: Sanitize return value from prom_nbputchar() Daniel Hellstrom
2011-01-04 17:50 ` [RFC 1/8] sparc: prom: Sanitize return value from David Miller
2011-01-04 19:51 ` [RFC 1/8] sparc: prom: Sanitize return value from prom_nbputchar() Julian Calaby
2011-01-05  8:58 ` Daniel Hellstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CF9BBFD.70503@gmail.com \
    --to=julian.calaby@gmail.com \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.