From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 8/8] Char: vt_ioctl, use wait_event_interruptible
Date: Mon, 28 May 2007 15:31:12 +0200 (CEST) [thread overview]
Message-ID: <3026996181117418@wsc.cz> (raw)
In-Reply-To: <12191294601255228079@wsc.cz>
vt_ioctl, use wait_event_interruptible
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
commit fbe1931e02f11b2fef771ff1698f1598b3567520
tree fcfcd72a5619f6e26598ac2ee3132aed4b070987
parent c025c4b3eca99f50b05bc24c445b861e91226539
author Jiri Slaby <jirislaby@gmail.com> Sat, 26 May 2007 22:58:17 +0200
committer Jiri Slaby <jirislaby@gmail.com> Sat, 26 May 2007 22:58:17 +0200
drivers/char/vt_ioctl.c | 22 ++++------------------
1 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index c6f6f42..2056367 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -1035,12 +1035,8 @@ static DECLARE_WAIT_QUEUE_HEAD(vt_activate_queue);
int vt_waitactive(int vt)
{
int retval;
- DECLARE_WAITQUEUE(wait, current);
-
- add_wait_queue(&vt_activate_queue, &wait);
- for (;;) {
- retval = 0;
+ return wait_event_interruptible(vt_activate_queue, ({
/*
* Synchronize with redraw_screen(). By acquiring the console
* semaphore we make sure that the console switch is completed
@@ -1049,20 +1045,10 @@ int vt_waitactive(int vt)
* updated, but the console switch hasn't been completed.
*/
acquire_console_sem();
- set_current_state(TASK_INTERRUPTIBLE);
- if (vt == fg_console) {
- release_console_sem();
- break;
- }
+ retval = vt == fg_console;
release_console_sem();
- retval = -EINTR;
- if (signal_pending(current))
- break;
- schedule();
- }
- remove_wait_queue(&vt_activate_queue, &wait);
- __set_current_state(TASK_RUNNING);
- return retval;
+ retval;
+ }));
}
#define vt_wake_waitactive() wake_up(&vt_activate_queue)
next prev parent reply other threads:[~2007-05-28 13:31 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 ` [PATCH 5/8] Char: n_r3964, " Jiri Slaby
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 ` Jiri Slaby [this message]
2007-05-30 0:08 ` [PATCH 8/8] Char: vt_ioctl, use wait_event_interruptible 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=3026996181117418@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome