[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <ba7ad5b9cd57cae807823676f5a386ca57e997fe.1360677367.git.linux@horizon.com>
Date: Fri, 8 Feb 2013 01:50:18 -0500
From: George Spelvin <linux@...izon.com>
To: linux-serial@...r.kernel.org, peter@...leysoftware.com,
gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, giometti@...ux.it, linux@...izon.com
Subject: [PATCH v2 9/9] tty/tty_ldisc.c: use test_and_clear_bit in
tty_ldisc_close
We have a function to test and clear a bit in one step, so use it.
Signed-off-by: George Spelvin <linux@...izon.com>
---
drivers/tty/tty_ldisc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index c578229..4606ab9 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -453,8 +453,7 @@ static int tty_ldisc_open(struct tty_struct *tty, struct tty_ldisc *ld)
static void tty_ldisc_close(struct tty_struct *tty, struct tty_ldisc *ld)
{
- WARN_ON(!test_bit(TTY_LDISC_OPEN, &tty->flags));
- clear_bit(TTY_LDISC_OPEN, &tty->flags);
+ WARN_ON(!test_and_clear_bit(TTY_LDISC_OPEN, &tty->flags));
if (ld->ops->close)
ld->ops->close(tty);
}
--
1.8.1.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists