public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] s390 tty: Prepare for put_char to return success/fail
Date: Sun, 13 Apr 2008 18:06:08 +0100	[thread overview]
Message-ID: <20080413180608.1cc6f867@core> (raw)

Put the changes into the drivers first. This will still compile/work but
produce a warning if bisected so can still be debugged

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.25-rc8-mm2/drivers/s390/char/con3215.c linux-2.6.25-rc8-mm2/drivers/s390/char/con3215.c
--- linux.vanilla-2.6.25-rc8-mm2/drivers/s390/char/con3215.c	2008-04-13 12:55:48.000000000 +0100
+++ linux-2.6.25-rc8-mm2/drivers/s390/char/con3215.c	2008-04-13 15:40:58.000000000 +0100
@@ -982,15 +982,16 @@
 /*
  * Put character routine for 3215 ttys
  */
-static void
+static int
 tty3215_put_char(struct tty_struct *tty, unsigned char ch)
 {
 	struct raw3215_info *raw;
 
 	if (!tty)
-		return;
+		return 0;
 	raw = (struct raw3215_info *) tty->driver_data;
 	raw3215_putchar(raw, ch);
+	return 1;
 }
 
 static void
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.25-rc8-mm2/drivers/s390/char/sclp_tty.c linux-2.6.25-rc8-mm2/drivers/s390/char/sclp_tty.c
--- linux.vanilla-2.6.25-rc8-mm2/drivers/s390/char/sclp_tty.c	2008-04-13 15:36:54.000000000 +0100
+++ linux-2.6.25-rc8-mm2/drivers/s390/char/sclp_tty.c	2008-04-13 15:40:58.000000000 +0100
@@ -412,14 +412,14 @@
  * - including previous characters from sclp_tty_put_char() and strings from
  * sclp_write() without final '\n' - will be written.
  */
-static void
+static int
 sclp_tty_put_char(struct tty_struct *tty, unsigned char ch)
 {
 	sclp_tty_chars[sclp_tty_chars_count++] = ch;
 	if (ch == '\n' || sclp_tty_chars_count >= SCLP_TTY_BUF_SIZE) {
 		sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count);
 		sclp_tty_chars_count = 0;
-	}
+	} return 1;
 }
 
 /*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.25-rc8-mm2/drivers/s390/char/sclp_vt220.c linux-2.6.25-rc8-mm2/drivers/s390/char/sclp_vt220.c
--- linux.vanilla-2.6.25-rc8-mm2/drivers/s390/char/sclp_vt220.c	2008-04-13 15:36:54.000000000 +0100
+++ linux-2.6.25-rc8-mm2/drivers/s390/char/sclp_vt220.c	2008-04-13 15:40:58.000000000 +0100
@@ -524,11 +524,15 @@
  * NOTE: include/linux/tty_driver.h specifies that a character should be
  * ignored if there is no room in the queue. This driver implements a different
  * semantic in that it will block when there is no more room left.
+ *
+ * FIXME: putchar can currently be called from BH and other non blocking
+ * handlers so  this semantic isn't a good idea.
  */
-static void
+static int
 sclp_vt220_put_char(struct tty_struct *tty, unsigned char ch)
 {
 	__sclp_vt220_write(&ch, 1, 0, 0, 1);
+	return 1;
 }
 
 /*
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.25-rc8-mm2/drivers/s390/char/tty3270.c linux-2.6.25-rc8-mm2/drivers/s390/char/tty3270.c
--- linux.vanilla-2.6.25-rc8-mm2/drivers/s390/char/tty3270.c	2008-04-13 12:55:48.000000000 +0100
+++ linux-2.6.25-rc8-mm2/drivers/s390/char/tty3270.c	2008-04-13 15:40:58.000000000 +0100
@@ -965,7 +965,7 @@
  * Insert character into the screen at the current position with the
  * current color and highlight. This function does NOT do cursor movement.
  */
-static void
+static int
 tty3270_put_character(struct tty3270 *tp, char ch)
 {
 	struct tty3270_line *line;
@@ -986,6 +986,7 @@
 	cell->character = tp->view.ascebc[(unsigned int) ch];
 	cell->highlight = tp->highlight;
 	cell->f_color = tp->f_color;
+	return 1;
 }
 
 /*

                 reply	other threads:[~2008-04-13 17:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080413180608.1cc6f867@core \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox