public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: <linux-kernel@vger.kernel.org>, <support@moxa.com.tw>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH 2/6] Char: mxser_new, testbit for bit testing
Date: Sat,  7 Oct 2006 01:01:56 +0200 (CEST)	[thread overview]
Message-ID: <34287982324@wsc.cz> (raw)

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>

---
commit 104fc67145e462bc89c0f778a1907f96cd150873
tree 8d0fff4e5ead2913954f3a73127e74e898d0d1f2
parent f1ec019ded64c90bc2c8017a41bd77c8f900711c
author Jiri Slaby <jirislaby@gmail.com> Fri, 06 Oct 2006 23:39:18 +0200
committer Jiri Slaby <xslaby@anemoi.localdomain> Fri, 06 Oct 2006 23:39:18 +0200

 drivers/char/mxser_new.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index 1f53e07..84d72aa 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -461,7 +461,8 @@ static int mxser_block_til_ready(struct 
 	 * 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_str
 
 	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_str
 
 	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
 	}
 	/* 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);

                 reply	other threads:[~2006-10-06 23:01 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=34287982324@wsc.cz \
    --to=jirislaby@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=support@moxa.com.tw \
    /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