From: Jiri Slaby <jirislaby@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, Jiri Slaby <jirislaby@gmail.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH 2/2] Char: epca, fix ASYNC flags
Date: Fri, 8 May 2009 10:32:44 +0200 [thread overview]
Message-ID: <1241771564-31133-2-git-send-email-jirislaby@gmail.com> (raw)
In-Reply-To: <8763gcsa5e.fsf@tac.ki.iif.hu>
ASYNC_* flags are not bits, but rather constants, use ilog2 to obtain
bit positions and stay atomic.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
---
drivers/char/epca.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index 8797b77..01948e4 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -1518,7 +1518,7 @@ static void doevent(int crd)
if (event & MODEMCHG_IND) {
/* A modem signal change has been indicated */
ch->imodem = mstat;
- if (test_bit(ASYNC_CHECK_CD, &ch->port.flags)) {
+ if (test_bit(ilog2(ASYNC_CHECK_CD), &ch->port.flags)) {
/* We are now receiving dcd */
if (mstat & ch->dcd)
wake_up_interruptible(&ch->port.open_wait);
@@ -1765,9 +1765,9 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch)
* that the driver will wait on carrier detect.
*/
if (ts->c_cflag & CLOCAL)
- clear_bit(ASYNC_CHECK_CD, &ch->port.flags);
+ clear_bit(ilog2(ASYNC_CHECK_CD), &ch->port.flags);
else
- set_bit(ASYNC_CHECK_CD, &ch->port.flags);
+ set_bit(ilog2(ASYNC_CHECK_CD), &ch->port.flags);
mval = ch->m_dtr | ch->m_rts;
} /* End CBAUD not detected */
iflag = termios2digi_i(ch, ts->c_iflag);
@@ -2244,7 +2244,8 @@ static void do_softint(struct work_struct *work)
if (test_and_clear_bit(EPCA_EVENT_HANGUP, &ch->event)) {
tty_hangup(tty);
wake_up_interruptible(&ch->port.open_wait);
- clear_bit(ASYNC_NORMAL_ACTIVE, &ch->port.flags);
+ clear_bit(ilog2(ASYNC_NORMAL_ACTIVE),
+ &ch->port.flags);
}
}
tty_kref_put(tty);
--
1.6.2.4
next prev parent reply other threads:[~2009-05-08 8:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-08 0:36 rocket tty BUG in 2.6.29 (regression) Ferenc Wagner
2009-05-08 8:32 ` [PATCH 1/2] Char: rocket, fix ASYNC flags Jiri Slaby
2009-05-08 11:13 ` Alan Cox
2009-05-08 11:18 ` Jiri Slaby
2009-05-08 8:32 ` Jiri Slaby [this message]
2009-05-08 10:03 ` rocket tty BUG in 2.6.29 (regression) Alan Cox
2009-05-08 14:33 ` Ferenc Wagner
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=1241771564-31133-2-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 \
/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