Skip to contentSkip to conversation

net/pcnet32: replace schedule_timeout() with msleep_interruptible()

PATCH In review [email protected] 3 participants 3 messages Oct 30, 2004 – Nov 1, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 11/18 net/pcnet32: replace schedule_timeout() with msleep_interruptible()

Any comments would be appreciated.

Description: Use msleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected.

---

 linux-2.6.10-rc1-max/drivers/net/pcnet32.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/net/pcnet32.c renamed from drivers/net/pcnet32.c~msleep_interruptible-drivers_net_pcnet32 +1 -1
diff -puN drivers/net/pcnet32.c~msleep_interruptible-drivers_net_pcnet32 drivers/net/pcnet32.c
@@ -847,7 +847,7 @@ static int pcnet32_phys_id(struct net_de
     if ((!data) || (data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)))
     data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
 
-    schedule_timeout(data * HZ);
+    msleep_interruptible(data * 1000);
     del_timer_sync(&lp->blink_timer);
 
     /* Restore the original value of the bcrs */

_

#1 lore raw

drivers/net/pcnet32.c static int pcnet32_phys_id(struct net_de · line 850

Quoted 9 lines · [email protected] wrote:

diff -puN drivers/net/pcnet32.c~msleep_interruptible-drivers_net_pcnet32 drivers/net/pcnet32.c

drivers/net/pcnet32.c renamed from drivers/net/pcnet32.c~msleep_interruptible-drivers_net_pcnet32 +1 -1
@@ -847,7 +847,7 @@ static int pcnet32_phys_id(struct net_de
     if ((!data) || (data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)))
     data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
 
-    schedule_timeout(data * HZ);
+    msleep_interruptible(data * 1000);

clearly and obviously ssleep()

#2 lore raw

PATCH 1/1 net/pcnet32: replace schedule_timeout() with ssleep_interruptible()

Quoted 11 lines · Jeff Garzik
Quoted 10 lines · [email protected] wrote:

diff -puN drivers/net/pcnet32.c~msleep_interruptible-drivers_net_pcnet32 drivers/net/pcnet32.c
---
linux-2.6.10-rc1/drivers/net/pcnet32.c~msleep_interruptible-drivers_net_pcnet32 2004-10-24 17:05:14.000000000 +0200
+++ linux-2.6.10-rc1-max/drivers/net/pcnet32.c 2004-10-24
17:05:14.000000000 +0200

(quoted diff) +0 -0
@@ -847,7 +847,7 @@ static int pcnet32_phys_id(struct net_de
    if ((!data) || (data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)))
    data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
 
Quoted 5 lines

Review static int pcnet32_phys_id(struct net_de · line 850

Quoted 2 lines
(quoted diff) +1 -1
-    schedule_timeout(data * HZ);
+    msleep_interruptible(data * 1000);

clearly and obviously ssleep()

Here is the corrected patch.

Description: Use ssleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected.

drivers/net/pcnet32.c +1 -1
@@ -847,7 +847,7 @@ static int pcnet32_phys_id(struct net_de
     if ((!data) || (data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)))
     data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
 
-    schedule_timeout(data * HZ);
+    ssleep_interruptible(data);
     del_timer_sync(&lp->blink_timer);
 
     /* Restore the original value of the bcrs */

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors