2.1.127pre7: Some random ->timeout patches

Horst von Brand (vonbrand@sleipnir.valparaiso.cl)
Thu, 05 Nov 1998 00:01:11 -0400


Found while building the kernel here. I had to delete support for Mitsumi
CDs (No, I don't use it. A friend has one, but I never got it to work
either), the use of ->timeout in there is scary to me ;-) The handling in
drivers/net/sktr.c also looks fishy to my untrained eye.

BTW, why aren't all the *_sleep() functions in drivers/block/paride/*.c
folded into one? They are identical.

--- linux/drivers/net/sktr.c.dist-2.1.127pre7 Tue Oct 27 21:38:18 1998
+++ linux/drivers/net/sktr.c Wed Nov 4 23:33:22 1998
@@ -1528,9 +1528,8 @@

tmp = jiffies + time/(1000000/HZ);
do {
- current->timeout = tmp;
current->state = TASK_INTERRUPTIBLE;
- schedule();
+ schedule_timeout(time/(1000000/HZ));
} while(tmp > jiffies);

return;
--- linux/drivers/block/paride/pcd.c.dist-2.1.127pre7 Mon Sep 28 14:51:16 1998
+++ linux/drivers/block/paride/pcd.c Wed Nov 4 22:08:58 1998
@@ -559,8 +559,7 @@
static void pcd_sleep( int cs )

{ current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + cs;
- schedule();
+ schedule_timeout(cs);
}

static int pcd_reset( int unit )
--- linux/drivers/block/paride/pf.c.dist-2.1.127pre7 Mon Sep 28 14:51:16 1998
+++ linux/drivers/block/paride/pf.c Wed Nov 4 22:45:13 1998
@@ -660,8 +660,7 @@
static void pf_sleep( int cs )

{ current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + cs;
- schedule();
+ schedule_timeout(cs);
}


--- linux/drivers/block/paride/pt.c.dist-2.1.127pre7 Mon Sep 28 14:51:16 1998
+++ linux/drivers/block/paride/pt.c Wed Nov 4 22:46:16 1998
@@ -464,8 +464,7 @@
static void pt_sleep( int cs )

{ current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + cs;
- schedule();
+ schedule_timeout(cs);
}

static int pt_poll_dsc( int unit, int pause, int tmo, char *msg )
--- linux/drivers/block/paride/pg.c.dist-2.1.127pre7 Mon Sep 28 14:51:16 1998
+++ linux/drivers/block/paride/pg.c Wed Nov 4 22:47:28 1998
@@ -357,8 +357,7 @@
static void pg_sleep( int cs )

{ current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + cs;
- schedule();
+ schedule_timeout(cs);
}

static int pg_wait( int unit, int go, int stop, int tmo, char * msg )
--- linux/drivers/sound/cs4232.c.dist-2.1.127pre7 Wed Jul 22 16:45:52 1998
+++ linux/drivers/sound/cs4232.c Wed Nov 4 22:50:58 1998
@@ -96,9 +96,7 @@
static void sleep(unsigned howlong)
{
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + howlong;
- schedule();
- current->timeout = 0;
+ schedule_timeout(howlong);
}

int probe_cs4232(struct address_info *hw_config)
--- linux/drivers/cdrom/mcd.c.dist-2.1.127pre7 Sat Jun 13 16:05:22 1998
+++ linux/drivers/cdrom/mcd.c Wed Nov 4 22:52:31 1998
@@ -1100,8 +1100,7 @@
return -EIO; /* drive doesn't respond */
if ((st & MST_READY) == 0) { /* no disk? wait a sec... */
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + HZ;
- schedule();
+ schedule_timeout(HZ);
}
} while (((st & MST_READY) == 0) && count++ < MCD_RETRY_ATTEMPTS);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/