From: Nishanth Aravamudan <[email-masked]>

Use schedule_timeout_interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size.

(akpm: this patch relies on other stuff in -mm, please don't apply)

Signed-off-by: Nishanth Aravamudan <[email-masked]>
Cc: Jeff Garzik <[email-masked]>
Cc: "David S. Miller" <[email-masked]>
Signed-off-by: Andrew Morton <[email-masked]>
---

 drivers/net/8139cp.c                      |    3 -
 drivers/net/hp100.c                       |   48 ++++++++++--------------------
 drivers/net/irda/stir4200.c               |    7 +---
 drivers/net/ixgb/ixgb_ethtool.c           |    7 +---
 drivers/net/ns83820.c                     |    3 -
 drivers/net/tokenring/ibmtr.c             |    9 ++---
 drivers/net/tokenring/olympic.c           |    2 -
 drivers/net/tokenring/tms380tr.c          |    3 -
 drivers/net/typhoon.c                     |    7 +---
 drivers/net/wan/cosa.c                    |    6 +--
 drivers/net/wan/dscc4.c                   |    9 +----
 drivers/net/wan/farsync.c                 |    3 -
 drivers/net/wireless/ipw2100.c            |   17 +++-------
 drivers/net/wireless/prism54/islpci_dev.c |    6 +--
 drivers/net/wireless/prism54/islpci_mgt.c |    5 +--
 include/linux/ibmtr.h                     |    4 +-
 include/linux/netdevice.h                 |    6 +--
 17 files changed, 53 insertions(+), 92 deletions(-)

diff -puN drivers/net/8139cp.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/8139cp.c
--- devel/drivers/net/8139cp.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:23.000000000 -0700
+++ devel-akpm/drivers/net/8139cp.c	2005-08-30 18:46:24.000000000 -0700
@@ -1029,8 +1029,7 @@ static void cp_reset_hw (struct cp_priva
 		if (!(cpr8(Cmd) & CmdReset))
 			return;
 
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(10);
+		schedule_timeout_uninterruptible(10);
 	}
 
 	printk(KERN_ERR "%s: hardware reset timeout\n", cp->dev->name);
diff -puN drivers/net/hp100.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/hp100.c
--- devel/drivers/net/hp100.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:23.000000000 -0700
+++ devel-akpm/drivers/net/hp100.c	2005-08-30 18:46:24.000000000 -0700
@@ -2517,10 +2517,8 @@ static int hp100_down_vg_link(struct net
 	do {
 		if (hp100_inb(VG_LAN_CFG_1) & HP100_LINK_CABLE_ST)
 			break;
-		if (!in_interrupt()) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1);
-		}
+		if (!in_interrupt())
+			schedule_timeout_interruptible(1);
 	} while (time_after(time, jiffies));
 
 	if (time_after_eq(jiffies, time))	/* no signal->no logout */
@@ -2536,10 +2534,8 @@ static int hp100_down_vg_link(struct net
 	do {
 		if (!(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST))
 			break;
-		if (!in_interrupt()) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1);
-		}
+		if (!in_interrupt())
+			schedule_timeout_interruptible(1);
 	} while (time_after(time, jiffies));
 
 #ifdef HP100_DEBUG
@@ -2577,10 +2573,8 @@ static int hp100_down_vg_link(struct net
 		do {
 			if (!(hp100_inb(MAC_CFG_4) & HP100_MAC_SEL_ST))
 				break;
-			if (!in_interrupt()) {
-				set_current_state(TASK_INTERRUPTIBLE);
-				schedule_timeout(1);
-			}
+			if (!in_interrupt())
+				schedule_timeout_interruptible(1);
 		} while (time_after(time, jiffies));
 
 		hp100_orb(HP100_AUTO_MODE, MAC_CFG_3);	/* Autosel back on */
@@ -2591,10 +2585,8 @@ static int hp100_down_vg_link(struct net
 	do {
 		if ((hp100_inb(VG_LAN_CFG_1) & HP100_LINK_CABLE_ST) == 0)
 			break;
-		if (!in_interrupt()) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1);
-		}
+		if (!in_interrupt())
+			schedule_timeout_interruptible(1);
 	} while (time_after(time, jiffies));
 
 	if (time_before_eq(time, jiffies)) {
@@ -2606,10 +2598,8 @@ static int hp100_down_vg_link(struct net
 
 	time = jiffies + (2 * HZ);	/* This seems to take a while.... */
 	do {
-		if (!in_interrupt()) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1);
-		}
+		if (!in_interrupt())
+			schedule_timeout_interruptible(1);
 	} while (time_after(time, jiffies));
 
 	return 0;
@@ -2659,10 +2649,8 @@ static int hp100_login_to_vg_hub(struct 
 		do {
 			if (~(hp100_inb(VG_LAN_CFG_1) & HP100_LINK_UP_ST))
 				break;
-			if (!in_interrupt()) {
-				set_current_state(TASK_INTERRUPTIBLE);
-				schedule_timeout(1);
-			}
+			if (!in_interrupt())
+				schedule_timeout_interruptible(1);
 		} while (time_after(time, jiffies));
 
 		/* Start an addressed training and optionally request promiscuous port */
@@ -2697,10 +2685,8 @@ static int hp100_login_to_vg_hub(struct 
 		do {
 			if (hp100_inb(VG_LAN_CFG_1) & HP100_LINK_CABLE_ST)
 				break;
-			if (!in_interrupt()) {
-				set_current_state(TASK_INTERRUPTIBLE);
-				schedule_timeout(1);
-			}
+			if (!in_interrupt())
+				schedule_timeout_interruptible(1);
 		} while (time_before(jiffies, time));
 
 		if (time_after_eq(jiffies, time)) {
@@ -2723,10 +2709,8 @@ static int hp100_login_to_vg_hub(struct 
 #endif
 					break;
 				}
-				if (!in_interrupt()) {
-					set_current_state(TASK_INTERRUPTIBLE);
-					schedule_timeout(1);
-				}
+				if (!in_interrupt())
+					schedule_timeout_interruptible(1);
 			} while (time_after(time, jiffies));
 		}
 
diff -puN drivers/net/irda/stir4200.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/irda/stir4200.c
--- devel/drivers/net/irda/stir4200.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:23.000000000 -0700
+++ devel-akpm/drivers/net/irda/stir4200.c	2005-08-30 18:46:24.000000000 -0700
@@ -678,10 +678,9 @@ static void turnaround_delay(const struc
 		return;
 
 	ticks = us / (1000000 / HZ);
-	if (ticks > 0) {
-		current->state = TASK_INTERRUPTIBLE;
-		schedule_timeout(1 + ticks);
-	} else
+	if (ticks > 0)
+		schedule_timeout_interruptible(1 + ticks);
+	else
 		udelay(us);
 }
 
diff -puN drivers/net/ixgb/ixgb_ethtool.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/ixgb/ixgb_ethtool.c
--- devel/drivers/net/ixgb/ixgb_ethtool.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:23.000000000 -0700
+++ devel-akpm/drivers/net/ixgb/ixgb_ethtool.c	2005-08-30 18:46:24.000000000 -0700
@@ -645,11 +645,10 @@ ixgb_phys_id(struct net_device *netdev, 
 
 	mod_timer(&adapter->blink_timer, jiffies);
 
-	set_current_state(TASK_INTERRUPTIBLE);
-	if(data)
-		schedule_timeout(data * HZ);
+	if (data)
+		schedule_timeout_interruptible(data * HZ);
 	else
-		schedule_timeout(MAX_SCHEDULE_TIMEOUT);
+		schedule_timeout_interruptible(MAX_SCHEDULE_TIMEOUT);
 
 	del_timer_sync(&adapter->blink_timer);
 	ixgb_led_off(&adapter->hw);
diff -puN drivers/net/ns83820.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/ns83820.c
--- devel/drivers/net/ns83820.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:23.000000000 -0700
+++ devel-akpm/drivers/net/ns83820.c	2005-08-30 18:46:24.000000000 -0700
@@ -1632,8 +1632,7 @@ static void ns83820_run_bist(struct net_
 			timed_out = 1;
 			break;
 		}
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(1);
+		schedule_timeout_uninterruptible(1);
 	}
 
 	if (status & fail)
diff -puN drivers/net/tokenring/ibmtr.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/tokenring/ibmtr.c
--- devel/drivers/net/tokenring/ibmtr.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:23.000000000 -0700
+++ devel-akpm/drivers/net/tokenring/ibmtr.c	2005-08-30 18:46:24.000000000 -0700
@@ -318,7 +318,7 @@ static void ibmtr_cleanup_card(struct ne
 	if (dev->base_addr) {
 		outb(0,dev->base_addr+ADAPTRESET);
 		
-		schedule_timeout(TR_RST_TIME); /* wait 50ms */
+		schedule_timeout_uninterruptible(TR_RST_TIME); /* wait 50ms */
 
 		outb(0,dev->base_addr+ADAPTRESETREL);
 	}
@@ -859,8 +859,7 @@ static int tok_init_card(struct net_devi
 	writeb(~INT_ENABLE, ti->mmio + ACA_OFFSET + ACA_RESET + ISRP_EVEN);
 	outb(0, PIOaddr + ADAPTRESET);
 
-	current->state=TASK_UNINTERRUPTIBLE;
-	schedule_timeout(TR_RST_TIME); /* wait 50ms */
+	schedule_timeout_uninterruptible(TR_RST_TIME); /* wait 50ms */
 
 	outb(0, PIOaddr + ADAPTRESETREL);
 #ifdef ENABLE_PAGING
@@ -908,8 +907,8 @@ static int tok_open(struct net_device *d
 			DPRINTK("Adapter is up and running\n");
 			return 0;
 		}
-		current->state=TASK_INTERRUPTIBLE;
-		i=schedule_timeout(TR_RETRY_INTERVAL); /* wait 30 seconds */
+		i=schedule_timeout_interruptible(TR_RETRY_INTERVAL);
+							/* wait 30 seconds */
 		if(i!=0) break; /*prob. a signal, like the i>24*HZ case above */
 	}
 	outb(0, dev->base_addr + ADAPTRESET);/* kill pending interrupts*/
diff -puN drivers/net/tokenring/olympic.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/tokenring/olympic.c
--- devel/drivers/net/tokenring/olympic.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:23.000000000 -0700
+++ devel-akpm/drivers/net/tokenring/olympic.c	2005-08-30 18:46:24.000000000 -0700
@@ -1101,7 +1101,7 @@ static int olympic_close(struct net_devi
 
 	while(olympic_priv->srb_queued) {
 
-		t = schedule_timeout(60*HZ); 
+		t = schedule_timeout_interruptible(60*HZ);
 
         	if(signal_pending(current))	{            
 			printk(KERN_WARNING "%s: SRB timed out.\n",dev->name);
diff -puN drivers/net/tokenring/tms380tr.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/tokenring/tms380tr.c
--- devel/drivers/net/tokenring/tms380tr.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:23.000000000 -0700
+++ devel-akpm/drivers/net/tokenring/tms380tr.c	2005-08-30 18:46:24.000000000 -0700
@@ -1243,8 +1243,7 @@ void tms380tr_wait(unsigned long time)
 	
 	tmp = jiffies + time/(1000000/HZ);
 	do {
-  		current->state 		= TASK_INTERRUPTIBLE;
-		tmp = schedule_timeout(tmp);
+		tmp = schedule_timeout_interruptible(tmp);
 	} while(time_after(tmp, jiffies));
 #else
 	udelay(time);
diff -puN drivers/net/typhoon.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/typhoon.c
--- devel/drivers/net/typhoon.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:24.000000000 -0700
+++ devel-akpm/drivers/net/typhoon.c	2005-08-30 18:46:24.000000000 -0700
@@ -419,10 +419,9 @@ typhoon_reset(void __iomem *ioaddr, int 
 			   TYPHOON_STATUS_WAITING_FOR_HOST)
 				goto out;
 
-			if(wait_type == WaitSleep) {
-				set_current_state(TASK_UNINTERRUPTIBLE);
-				schedule_timeout(1);
-			} else
+			if(wait_type == WaitSleep)
+				schedule_timeout_uninterruptible(1);
+			else
 				udelay(TYPHOON_UDELAY);
 		}
 
diff -puN drivers/net/wan/cosa.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/wan/cosa.c
--- devel/drivers/net/wan/cosa.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:24.000000000 -0700
+++ devel-akpm/drivers/net/wan/cosa.c	2005-08-30 18:46:24.000000000 -0700
@@ -1617,8 +1617,7 @@ static int get_wait_data(struct cosa_dat
 			return r;
 		}
 		/* sleep if not ready to read */
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(1);
+		schedule_timeout_interruptible(1);
 	}
 	printk(KERN_INFO "cosa: timeout in get_wait_data (status 0x%x)\n",
 		cosa_getstatus(cosa));
@@ -1644,8 +1643,7 @@ static int put_wait_data(struct cosa_dat
 		}
 #if 0
 		/* sleep if not ready to read */
-		current->state = TASK_INTERRUPTIBLE;
-		schedule_timeout(1);
+		schedule_timeout_interruptible(1);
 #endif
 	}
 	printk(KERN_INFO "cosa%d: timeout in put_wait_data (status 0x%x)\n",
diff -puN drivers/net/wan/dscc4.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/wan/dscc4.c
--- devel/drivers/net/wan/dscc4.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:24.000000000 -0700
+++ devel-akpm/drivers/net/wan/dscc4.c	2005-08-30 18:46:24.000000000 -0700
@@ -542,8 +542,7 @@ static int dscc4_wait_ack_cec(struct dsc
 			       msg, i);
 			goto done;
 		}
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(10);
+		schedule_timeout_uninterruptible(10);
 		rmb();
 	} while (++i > 0);
 	printk(KERN_ERR "%s: %s timeout\n", dev->name, msg);
@@ -588,8 +587,7 @@ static inline int dscc4_xpr_ack(struct d
 		    (dpriv->iqtx[cur] & Xpr))
 			break;
 		smp_rmb();
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(10);
+		schedule_timeout_uninterruptible(10);
 	} while (++i > 0);
 
 	return (i >= 0 ) ? i : -EAGAIN;
@@ -1035,8 +1033,7 @@ static void dscc4_pci_reset(struct pci_d
 	/* Flush posted writes */
 	readl(ioaddr + GSTAR);
 
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(10);
+	schedule_timeout_uninterruptible(10);
 
 	for (i = 0; i < 16; i++)
 		pci_write_config_dword(pdev, i << 2, dscc4_pci_config_store[i]);
diff -puN drivers/net/wan/farsync.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/wan/farsync.c
--- devel/drivers/net/wan/farsync.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:24.000000000 -0700
+++ devel-akpm/drivers/net/wan/farsync.c	2005-08-30 18:46:24.000000000 -0700
@@ -980,8 +980,7 @@ fst_issue_cmd(struct fst_port_info *port
 	/* Wait for any previous command to complete */
 	while (mbval > NAK) {
 		spin_unlock_irqrestore(&card->card_lock, flags);
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(1);
+		schedule_timeout_uninterruptible(1);
 		spin_lock_irqsave(&card->card_lock, flags);
 
 		if (++safety > 2000) {
diff -puN drivers/net/wireless/ipw2100.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/wireless/ipw2100.c
--- devel/drivers/net/wireless/ipw2100.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:24.000000000 -0700
+++ devel-akpm/drivers/net/wireless/ipw2100.c	2005-08-30 18:46:24.000000000 -0700
@@ -800,8 +800,7 @@ static int ipw2100_hw_send_command(struc
 	 * doesn't seem to have as many firmware restart cycles...
 	 *
 	 * As a test, we're sticking in a 1/100s delay here */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(HZ / 100);
+	schedule_timeout_uninterruptible(msecs_to_jiffies(10));
 
 	return 0;
 
@@ -1248,8 +1247,7 @@ static int ipw2100_start_adapter(struct 
 	IPW_DEBUG_FW("Waiting for f/w initialization to complete...\n");
 	i = 5000;
 	do {
-  		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(40 * HZ / 1000);
+		schedule_timeout_uninterruptible(msecs_to_jiffies(40));
 		/* Todo... wait for sync command ... */
 
 		read_register(priv->net_dev, IPW_REG_INTA, &inta);
@@ -1400,8 +1398,7 @@ static int ipw2100_hw_phy_off(struct ipw
 		    (val2 & IPW2100_COMMAND_PHY_OFF))
 			return 0;
 
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HW_PHY_OFF_LOOP_DELAY);
+		schedule_timeout_uninterruptible(HW_PHY_OFF_LOOP_DELAY);
 	}
 
 	return -EIO;
@@ -1455,7 +1452,7 @@ fail_up:
 
 static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv)
 {
-#define HW_POWER_DOWN_DELAY (HZ / 10)
+#define HW_POWER_DOWN_DELAY (msecs_to_jiffies(100))
 
 	struct host_command cmd = {
 		.host_command = HOST_PRE_POWER_DOWN,
@@ -1509,10 +1506,8 @@ static int ipw2100_hw_stop_adapter(struc
 			printk(KERN_WARNING DRV_NAME ": "
 			       "%s: Power down command failed: Error %d\n",
 			       priv->net_dev->name, err);
-		else {
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(HW_POWER_DOWN_DELAY);
-		}
+		else
+			schedule_timeout_uninterruptible(HW_POWER_DOWN_DELAY);
 	}
 
 	priv->status &= ~STATUS_ENABLED;
diff -puN drivers/net/wireless/prism54/islpci_dev.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/wireless/prism54/islpci_dev.c
--- devel/drivers/net/wireless/prism54/islpci_dev.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:24.000000000 -0700
+++ devel-akpm/drivers/net/wireless/prism54/islpci_dev.c	2005-08-30 18:46:24.000000000 -0700
@@ -439,8 +439,7 @@ prism54_bring_down(islpci_private *priv)
 	wmb();
 
 	/* wait a while for the device to reset */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(50*HZ/1000);
+	schedule_timeout_uninterruptible(msecs_to_jiffies(50));
 
 	return 0;
 }
@@ -491,8 +490,7 @@ islpci_reset_if(islpci_private *priv)
 		/* The software reset acknowledge needs about 220 msec here.
 		 * Be conservative and wait for up to one second. */
 	
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		remaining = schedule_timeout(HZ);
+		remaining = schedule_timeout_uninterruptible(HZ);
 
 		if(remaining > 0) {
 			result = 0;
diff -puN drivers/net/wireless/prism54/islpci_mgt.c~drivers-net-fix-up-schedule_timeout-usage drivers/net/wireless/prism54/islpci_mgt.c
--- devel/drivers/net/wireless/prism54/islpci_mgt.c~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:24.000000000 -0700
+++ devel-akpm/drivers/net/wireless/prism54/islpci_mgt.c	2005-08-30 18:46:24.000000000 -0700
@@ -455,7 +455,7 @@ islpci_mgt_transaction(struct net_device
 		       struct islpci_mgmtframe **recvframe)
 {
 	islpci_private *priv = netdev_priv(ndev);
-	const long wait_cycle_jiffies = (ISL38XX_WAIT_CYCLE * 10 * HZ) / 1000;
+	const long wait_cycle_jiffies = msecs_to_jiffies(ISL38XX_WAIT_CYCLE * 10);
 	long timeout_left = ISL38XX_MAX_WAIT_CYCLES * wait_cycle_jiffies;
 	int err;
 	DEFINE_WAIT(wait);
@@ -475,8 +475,7 @@ islpci_mgt_transaction(struct net_device
 		int timeleft;
 		struct islpci_mgmtframe *frame;
 
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		timeleft = schedule_timeout(wait_cycle_jiffies);
+		timeleft = schedule_timeout_uninterruptible(wait_cycle_jiffies);
 		frame = xchg(&priv->mgmt_received, NULL);
 		if (frame) {
 			if (frame->header->oid == oid) {
diff -puN include/linux/ibmtr.h~drivers-net-fix-up-schedule_timeout-usage include/linux/ibmtr.h
--- devel/include/linux/ibmtr.h~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:24.000000000 -0700
+++ devel-akpm/include/linux/ibmtr.h	2005-08-30 18:46:24.000000000 -0700
@@ -7,8 +7,8 @@
 /* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */
 
 #define TR_RETRY_INTERVAL	(30*HZ)	/* 500 on PC = 5 s */
-#define TR_RST_TIME		(HZ/20) /* 5 on PC = 50 ms */
-#define TR_BUSY_INTERVAL	(HZ/5)	/* 5 on PC = 200 ms */
+#define TR_RST_TIME		(msecs_to_jiffies(50))	/* 5 on PC = 50 ms */
+#define TR_BUSY_INTERVAL	(msecs_to_jiffies(200))	/* 5 on PC = 200 ms */
 #define TR_SPIN_INTERVAL	(3*HZ)	/* 3 seconds before init timeout */
 
 #define TR_ISA 1
diff -puN include/linux/netdevice.h~drivers-net-fix-up-schedule_timeout-usage include/linux/netdevice.h
--- devel/include/linux/netdevice.h~drivers-net-fix-up-schedule_timeout-usage	2005-08-30 18:46:24.000000000 -0700
+++ devel-akpm/include/linux/netdevice.h	2005-08-30 18:46:24.000000000 -0700
@@ -854,11 +854,9 @@ static inline void netif_rx_complete(str
 
 static inline void netif_poll_disable(struct net_device *dev)
 {
-	while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) {
+	while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state))
 		/* No hurry. */
-		current->state = TASK_INTERRUPTIBLE;
-		schedule_timeout(1);
-	}
+		schedule_timeout_interruptible(1);
 }
 
 static inline void netif_poll_enable(struct net_device *dev)
_