summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2006-12-08 11:38:25 +0100
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 17:28:54 +0100
commit214efebba86260a0fb3ef84b9f5707b58cbc227b (patch)
tree3ae0002bdf2bab8295e79ef4fe9def858f1e4f1b
parent[PATCH] Char: mxser_new, eliminate tty ldisc deref (diff)
downloadlinux-214efebba86260a0fb3ef84b9f5707b58cbc227b.tar.xz
linux-214efebba86260a0fb3ef84b9f5707b58cbc227b.zip
[PATCH] Char: mxser_new, testbit for bit testing
Use testbit like in tty subsystem for TTY_IO_ERROR testing. Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to '')
-rw-r--r--drivers/char/mxser_new.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index 71381f955567..c87bda388892 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -461,7 +461,8 @@ static int mxser_block_til_ready(struct tty_struct *tty, struct file *filp,
* If non-blocking mode is set, or the port is not enabled,
* then make the check up front and then exit.
*/
- if ((filp->f_flags & O_NONBLOCK) || (tty->flags & (1 << TTY_IO_ERROR))) {
+ if ((filp->f_flags & O_NONBLOCK) ||
+ test_bit(TTY_IO_ERROR, &tty->flags)) {
port->flags |= ASYNC_NORMAL_ACTIVE;
return 0;
}
@@ -1437,7 +1438,7 @@ static int mxser_tiocmget(struct tty_struct *tty, struct file *file)
if (tty->index == MXSER_PORTS)
return -ENOIOCTLCMD;
- if (tty->flags & (1 << TTY_IO_ERROR))
+ if (test_bit(TTY_IO_ERROR, &tty->flags))
return -EIO;
control = info->MCR;
@@ -1464,7 +1465,7 @@ static int mxser_tiocmset(struct tty_struct *tty, struct file *file,
if (tty->index == MXSER_PORTS)
return -ENOIOCTLCMD;
- if (tty->flags & (1 << TTY_IO_ERROR))
+ if (test_bit(TTY_IO_ERROR, &tty->flags))
return -EIO;
spin_lock_irqsave(&info->slock, flags);
@@ -1798,10 +1799,10 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
}
/* above add by Victor Yu. 01-05-2004 */
- if ((cmd != TIOCGSERIAL) && (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
- if (tty->flags & (1 << TTY_IO_ERROR))
- return -EIO;
- }
+ if (cmd != TIOCGSERIAL && cmd != TIOCMIWAIT && cmd != TIOCGICOUNT &&
+ test_bit(TTY_IO_ERROR, &tty->flags))
+ return -EIO;
+
switch (cmd) {
case TCSBRK: /* SVID version: non-zero arg --> no break */
retval = tty_check_change(tty);