From: janitor@sternwelten.at
To: akpm@digeo.com
Cc: linux-kernel@vger.kernel.org, janitor@sternwelten.at, nacc@us.ibm.com
Subject: [patch 06/26] char/ftape-io: replace schedule_timeout() with msleep_interruptible()
Date: Thu, 23 Sep 2004 22:25:10 +0200 [thread overview]
Message-ID: <E1CAa9O-0007xr-Dy@sputnik> (raw)
Any comments would be appreciated.
Description: Use msleep_interruptible() instead of schedule_timeout() to
guarantee the task delays as expected. In this case, this allowed for
the removal of the entire do-while.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
---
linux-2.6.9-rc2-bk7-max/drivers/char/ftape/lowlevel/ftape-io.c | 20 +++-------
1 files changed, 7 insertions(+), 13 deletions(-)
diff -puN drivers/char/ftape/lowlevel/ftape-io.c~msleep_interruptible-drivers_char_ftape-io drivers/char/ftape/lowlevel/ftape-io.c
--- linux-2.6.9-rc2-bk7/drivers/char/ftape/lowlevel/ftape-io.c~msleep_interruptible-drivers_char_ftape-io 2004-09-21 22:49:10.000000000 +0200
+++ linux-2.6.9-rc2-bk7-max/drivers/char/ftape/lowlevel/ftape-io.c 2004-09-21 22:49:48.000000000 +0200
@@ -32,6 +32,7 @@
#include <asm/system.h>
#include <linux/ioctl.h>
#include <linux/mtio.h>
+#include <linux/delay.h>
#include <linux/ftape.h>
#include <linux/qic117.h>
@@ -96,19 +97,12 @@ void ftape_sleep(unsigned int time)
timeout = ticks;
save_flags(flags);
sti();
- set_current_state(TASK_INTERRUPTIBLE);
- do {
- /* Mmm. Isn't current->blocked == 0xffffffff ?
- */
- if (signal_pending(current)) {
- TRACE(ft_t_err,
- "awoken by non-blocked signal :-(");
- break; /* exit on signal */
- }
- while (current->state != TASK_RUNNING) {
- timeout = schedule_timeout(timeout);
- }
- } while (timeout);
+ msleep_interruptible(jiffies_to_msecs(timeout));
+ /* Mmm. Isn't current->blocked == 0xffffffff ?
+ */
+ if (signal_pending(current)) {
+ TRACE(ft_t_err, "awoken by non-blocked signal :-(");
+ }
restore_flags(flags);
}
TRACE_EXIT;
_
reply other threads:[~2004-09-24 2:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1CAa9O-0007xr-Dy@sputnik \
--to=janitor@sternwelten.at \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nacc@us.ibm.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
all inboxes | Powered by JetHome®