From: George Spelvin <linux@horizon.com>
To: linux-serial@vger.kernel.org, peter@hurleysoftware.com,
gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, giometti@linux.it, linux@horizon.com
Subject: [PATCH v2 9/9] tty/tty_ldisc.c: use test_and_clear_bit in tty_ldisc_close
Date: Fri, 8 Feb 2013 01:50:18 -0500 [thread overview]
Message-ID: <ba7ad5b9cd57cae807823676f5a386ca57e997fe.1360677367.git.linux@horizon.com> (raw)
In-Reply-To: <cover.1360677367.git.linux@horizon.com>
We have a function to test and clear a bit in one step, so use it.
Signed-off-by: George Spelvin <linux@horizon.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
next prev parent reply other threads:[~2013-02-08 6:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-12 13:56 [PATCH v2 0/9] 3.8-rc regression with pps-ldisc due to 70ece7a731 George Spelvin
2013-02-06 15:55 ` [PATCH v2 7/9] tty: Remove ancient hardpps() Peter Hurley
2013-02-08 6:50 ` George Spelvin [this message]
2013-02-10 9:08 ` [PATCH v2 1/9] pps: Add pps_lookup_dev() function George Spelvin
2013-02-10 9:41 ` [PATCH v2 2/9] pps: Use pps_lookup_dev to reduce ldisc coupling George Spelvin
2013-02-10 9:43 ` [PATCH v2 4/9] pps: Don't crash the machine when exiting will do George Spelvin
2013-02-10 9:44 ` [PATCH v2 6/9] pps: Additional cleanups in uart_handle_dcd_change George Spelvin
2013-02-12 7:00 ` [PATCH v2 5/9] pps: Move timestamp read into PPS code proper George Spelvin
2013-02-13 18:16 ` Greg KH
2013-02-12 7:02 ` [PATCH v2 8/9] pps: Use a single cdev George Spelvin
2013-02-13 18:20 ` Greg KH
2013-02-13 18:35 ` George Spelvin
2013-02-13 18:47 ` Greg KH
2013-02-21 1:35 ` Peter Hurley
2013-02-12 7:27 ` [PATCH v2 3/9] pps: Fix a use-after free bug when unregistering a source George Spelvin
2013-02-13 16:45 ` [PATCH v2 0/9] 3.8-rc regression with pps-ldisc due to 70ece7a731 Greg KH
2013-02-13 17:11 ` Rodolfo Giometti
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=ba7ad5b9cd57cae807823676f5a386ca57e997fe.1360677367.git.linux@horizon.com \
--to=linux@horizon.com \
--cc=giometti@linux.it \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=peter@hurleysoftware.com \
/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;
as well as URLs for NNTP newsgroup(s).