LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Jiri Slaby <jirislaby@gmail.com>
Subject: [PATCH 1/1] tty: BKL pushdown fix
Date: Fri,  8 Feb 2008 20:04:47 +0100	[thread overview]
Message-ID: <1202497487-32550-1-git-send-email-jirislaby@gmail.com> (raw)
In-Reply-To: <20080208154208.0efd6885@core>

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
 drivers/char/n_hdlc.c  |    4 ++--
 drivers/char/n_r3964.c |    6 +++---
 drivers/char/n_tty.c   |    2 +-
 drivers/char/tty_io.c  |   16 +++++++++-------
 drivers/char/vt.c      |    8 ++++----
 5 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
index 0bc0498..77629da 100644
--- a/drivers/char/n_hdlc.c
+++ b/drivers/char/n_hdlc.c
@@ -579,7 +579,7 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
 	}
 
 	lock_kernel();
-	
+
 	for (;;) {
 		if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) {
 			unlock_kernel();
@@ -672,7 +672,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
 	}
 	
 	lock_kernel();
-	
+
 	add_wait_queue(&tty->write_wait, &wait);
 	set_current_state(TASK_INTERRUPTIBLE);
 	
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c
index 3eb7880..3f6486e 100644
--- a/drivers/char/n_r3964.c
+++ b/drivers/char/n_r3964.c
@@ -1074,7 +1074,7 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
 	int count;
 
 	TRACE_L("read()");
-	
+
 	lock_kernel();
 
 	pClient = findClient(pInfo, task_pid(current));
@@ -1165,7 +1165,7 @@ static ssize_t r3964_write(struct tty_struct *tty, struct file *file,
 	pHeader->owner = NULL;
 
 	lock_kernel();
-	
+
 	pClient = findClient(pInfo, task_pid(current));
 	if (pClient) {
 		pHeader->owner = pClient;
@@ -1182,7 +1182,7 @@ static ssize_t r3964_write(struct tty_struct *tty, struct file *file,
  */
 	add_tx_queue(pInfo, pHeader);
 	trigger_transmit(pInfo);
-	
+
 	unlock_kernel();
 
 	return 0;
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index a9c8c8f..79a052e 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -1303,7 +1303,7 @@ do_it_again:
 			return -ERESTARTSYS;
 	}
 	packet = tty->packet;
-	
+
 	add_wait_queue(&tty->read_wait, &wait);
 	while (nr) {
 		/* First test for status change. */
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 3d489ce..bf08a38 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1204,8 +1204,8 @@ static unsigned int hung_up_tty_poll(struct file *filp, poll_table *wait)
 	return POLLIN | POLLOUT | POLLERR | POLLHUP | POLLRDNORM | POLLWRNORM;
 }
 
-static long hung_up_tty_ioctl(struct inode *inode, struct file *file,
-			     unsigned int cmd, unsigned long arg)
+static long hung_up_tty_ioctl(struct file *file, unsigned int cmd,
+		unsigned long arg)
 {
 	return cmd == TIOCSPGRP ? -ENOTTY : -EIO;
 }
@@ -1259,7 +1259,7 @@ static const struct file_operations hung_up_tty_fops = {
 	.read		= hung_up_tty_read,
 	.write		= hung_up_tty_write,
 	.poll		= hung_up_tty_poll,
-	.ioctl		= hung_up_tty_ioctl,
+	.unlocked_ioctl	= hung_up_tty_ioctl,
 	.compat_ioctl	= hung_up_tty_compat_ioctl,
 	.release	= tty_release,
 };
@@ -3208,10 +3208,12 @@ static int tiocsetd(struct tty_struct *tty, int __user *p)
 
 	if (get_user(ldisc, p))
 		return -EFAULT;
-		
+
 	lock_kernel();
 	ret = tty_set_ldisc(tty, ldisc);
 	unlock_kernel();
+
+	return ret;
 }
 
 /**
@@ -3230,7 +3232,7 @@ static int tiocsetd(struct tty_struct *tty, int __user *p)
 static int send_break(struct tty_struct *tty, unsigned int duration)
 {
 	int retval = -EINTR;
-	
+
 	lock_kernel();
 	if (tty_write_lock(tty, 0) < 0)
 		goto out;
@@ -3345,9 +3347,9 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	/*
 	 * Break handling by driver
 	 */
-	 
+
 	retval = -EINVAL;
-	
+
 	if (!tty->driver->break_ctl) {
 		switch (cmd) {
 		case TIOCSBRK:
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index d6a3a2a..a26d65b 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2531,9 +2531,9 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
 	if (get_user(type, p))
 		return -EFAULT;
 	ret = 0;
-	
+
 	lock_kernel();
-	
+
 	switch (type)
 	{
 		case TIOCL_SETSEL:
@@ -2553,7 +2553,7 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
 			ret = sel_loadlut(p);
 			break;
 		case TIOCL_GETSHIFTSTATE:
-			
+
 	/*
 	 * Make it possible to react to Shift+Mousebutton.
 	 * Note that 'shift_state' is an undocumented
@@ -3823,7 +3823,7 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op)
 		goto out;
 
 	c = (font.width+7)/8 * 32 * font.charcount;
-	
+
 	if (op->data && font.charcount > op->charcount)
 		rc = -ENOSPC;
 	if (!(op->flags & KD_FONT_FLAG_OLD)) {
-- 
1.5.3.8


  reply	other threads:[~2008-02-08 19:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08 15:42 [PATCH] tty: BKL pushdown Alan Cox
2008-02-08 19:04 ` Jiri Slaby [this message]
2008-02-08 21:35   ` [PATCH 1/1] tty: BKL pushdown fix Andrew Morton
2008-02-08 21:38     ` Jiri Slaby
2008-02-08 21:40       ` [PATCH 1/1] tty: BKL pushdown fix1 Jiri Slaby
2008-02-08 21:42         ` Jiri Slaby
2008-02-08 21:50         ` Alan Cox
2008-02-08 22:11       ` [PATCH 1/1] tty: BKL pushdown fix Andrew Morton
2008-02-08 22:15         ` Jiri Slaby

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=1202497487-32550-1-git-send-email-jirislaby@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 1/1] tty: BKL pushdown fix' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).