[PATCH] swim_iop: use msleep_interruptible() From: Nishanth Aravamudan Change the delay logic of swimiop_eject() to use time_before(). Rather than depend on the number of iterations of the loop for timing accuracy, I rely on the current value of jiffies relative to a static timeout (end_jiffies). Signed-off-by: Nishanth Aravamudan Signed-off-by: Domen Puncer Signed-off-by: Alexey Dobriyan Index: linux-kj/drivers/block/swim_iop.c =================================================================== --- linux-kj.orig/drivers/block/swim_iop.c 2005-12-05 13:18:01.000000000 +0300 +++ linux-kj/drivers/block/swim_iop.c 2005-12-05 13:19:38.000000000 +0300 @@ -317,7 +317,8 @@ static void swimiop_status_update(int dr static int swimiop_eject(struct floppy_state *fs) { - int err, n; + int err; + unsigned long end_jiffies; struct swim_iop_req req; struct swimcmd_eject *cmd = (struct swimcmd_eject *) &req.command[0]; @@ -332,8 +333,8 @@ static int swimiop_eject(struct floppy_s release_drive(fs); return err; } - for (n = 2*HZ; n > 0; --n) { - if (req.complete) break; + end_jiffies = jiffies + 2 * HZ; + while (!reg.complete && time_before(jiffies, end_jiffies)) { if (signal_pending(current)) { err = -EINTR; break;