From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 5/8] Char: n_r3964, use wait_event_interruptible
Date: Mon, 28 May 2007 15:29:08 +0200 (CEST) [thread overview]
Message-ID: <19836306752961214186@wsc.cz> (raw)
In-Reply-To: <12191294601255228079@wsc.cz>
n_r3964, use wait_event_interruptible
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
commit 2b7813d0f34703e0a4b18593a3186bdc7e719c06
tree 657e6eef237faac65c0c90920e3bb1ae5a8027d9
parent d45ae897fff813cf27d5d6ddfd92d19806831965
author Jiri Slaby <jirislaby@gmail.com> Sat, 26 May 2007 21:45:39 +0200
committer Jiri Slaby <jirislaby@gmail.com> Sat, 26 May 2007 21:45:39 +0200
drivers/char/n_r3964.c | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c
index 14557a4..6b918b8 100644
--- a/drivers/char/n_r3964.c
+++ b/drivers/char/n_r3964.c
@@ -1071,8 +1071,6 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
struct r3964_client_info *pClient;
struct r3964_message *pMsg;
struct r3964_client_message theMsg;
- DECLARE_WAITQUEUE(wait, current);
-
int count;
TRACE_L("read()");
@@ -1086,16 +1084,8 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
return -EAGAIN;
}
/* block until there is a message: */
- add_wait_queue(&pInfo->read_wait, &wait);
-repeat:
- __set_current_state(TASK_INTERRUPTIBLE);
- pMsg = remove_msg(pInfo, pClient);
- if (!pMsg && !signal_pending(current)) {
- schedule();
- goto repeat;
- }
- __set_current_state(TASK_RUNNING);
- remove_wait_queue(&pInfo->read_wait, &wait);
+ wait_event_interruptible(pInfo->read_wait,
+ (pMsg = remove_msg(pInfo, pClient)));
}
/* If we still haven't got a message, we must have been signalled */
next prev parent reply other threads:[~2007-05-28 13:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-28 13:26 [PATCH 1/8] Char: mxser_new, fix sparse warning Jiri Slaby
2007-05-28 13:27 ` [PATCH 2/8] Char: tty_ioctl, use wait_event_interruptible_timeout Jiri Slaby
2007-05-28 13:27 ` [PATCH 3/8] Char: tty_ioctl, little whitespace cleanup Jiri Slaby
2007-05-28 13:28 ` [PATCH 4/8] Char: genrtc, use wait_event_interruptible Jiri Slaby
2007-05-28 13:29 ` Jiri Slaby [this message]
2007-05-28 13:29 ` [PATCH 6/8] Char: rtc, " Jiri Slaby
2007-05-30 0:02 ` Andrew Morton
2007-05-28 13:30 ` [PATCH 7/8] Char: ip2, use msleep for sleeping Jiri Slaby
2007-05-28 13:31 ` [PATCH 8/8] Char: vt_ioctl, use wait_event_interruptible Jiri Slaby
2007-05-30 0:08 ` Andrew Morton
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=19836306752961214186@wsc.cz \
--to=jirislaby@gmail.com \
--cc=akpm@linux-foundation.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.