All of lore.kernel.org
 help / color / mirror / Atom feed
From: domen@coderock.org
To: sparclinux@vger.kernel.org
Subject: [patch 2/4] sbus/envctrl: replace schedule_timeout() with msleep_interruptible()
Date: Sun, 06 Mar 2005 22:29:00 +0000	[thread overview]
Message-ID: <20050306222900.90F341F201@trashy.coderock.org> (raw)



Use msleep_interruptible() instead of
schedule_timeout() to guarantee the task delays as expected. Change the units of
poll_interval to msecs as it is only used in this delay.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
---


 kj-domen/drivers/sbus/char/envctrl.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff -puN drivers/sbus/char/envctrl.c~msleep_interruptible-drivers_sbus_char_envctrl drivers/sbus/char/envctrl.c
--- kj/drivers/sbus/char/envctrl.c~msleep_interruptible-drivers_sbus_char_envctrl	2005-03-05 16:11:02.000000000 +0100
+++ kj-domen/drivers/sbus/char/envctrl.c	2005-03-05 16:11:02.000000000 +0100
@@ -1007,7 +1007,7 @@ static int kenvctrld(void *__unused)
 		return -ENODEV;
 	}
 
-	poll_interval = 5 * HZ; /* TODO env_mon_interval */
+	poll_interval = 5000; /* TODO env_mon_interval */
 
 	daemonize("kenvctrld");
 	allow_signal(SIGKILL);
@@ -1016,10 +1016,7 @@ static int kenvctrld(void *__unused)
 
 	printk(KERN_INFO "envctrl: %s starting...\n", current->comm);
 	for (;;) {
-		current->state = TASK_INTERRUPTIBLE;
-		schedule_timeout(poll_interval);
-
-		if(signal_pending(current))
+		if(msleep_interruptible(poll_interval))
 			break;
 
 		for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) {
_

             reply	other threads:[~2005-03-06 22:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-06 22:29 domen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-06-20 21:50 [patch 2/4] sbus/envctrl: replace schedule_timeout() with msleep_interruptible() domen

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=20050306222900.90F341F201@trashy.coderock.org \
    --to=domen@coderock.org \
    --cc=sparclinux@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.