From mboxrd@z Thu Jan 1 00:00:00 1970 From: maximilian attems Date: Tue, 21 Sep 2004 20:48:34 +0000 Subject: Re: [Kernel-janitors] [PATCH 2.6.9-rc2 8/33] char/ftape-io: replace Message-Id: <20040921204834.GB4260@stro.at> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============60472683090467738==" List-Id: References: <20040915225358.GO5778@us.ibm.com> In-Reply-To: <20040915225358.GO5778@us.ibm.com> To: kernel-janitors@vger.kernel.org --===============60472683090467738== Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, 15 Sep 2004, Nishanth Aravamudan wrote: > 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 > > --- 2.6.9-rc2-vanilla/drivers/char/ftape/lowlevel/ftape-io.c 2004-09-13 17:15:47.000000000 -0700 > +++ 2.6.9-rc2/drivers/char/ftape/lowlevel/ftape-io.c 2004-09-14 11:27:06.000000000 -0700 > @@ -96,19 +96,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; this one missed an include too. fixed for next kjt. a++ maks --===============60472683090467738== Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.osdl.org http://lists.osdl.org/mailman/listinfo/kernel-janitors --===============60472683090467738==--