diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-09-11 05:09:55 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-14 08:33:24 -0400 |
commit | 3173c8907ffb2c64456142da3df2bd0500bd59e0 (patch) | |
tree | dcd3700a2c37e24a2b5911bb5429aee715684926 /drivers/net/wan | |
parent | 343c686c04eec556645f251f7d6c9b3d7335dae0 (diff) |
[PATCH] drivers/net: fix-up schedule_timeout() usage
Use schedule_timeout_interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r-- | drivers/net/wan/cosa.c | 6 | ||||
-rw-r--r-- | drivers/net/wan/dscc4.c | 9 | ||||
-rw-r--r-- | drivers/net/wan/farsync.c | 3 |
3 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index 7ff814fd65d0..ae9e897c255e 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c | |||
@@ -1617,8 +1617,7 @@ static int get_wait_data(struct cosa_data *cosa) | |||
1617 | return r; | 1617 | return r; |
1618 | } | 1618 | } |
1619 | /* sleep if not ready to read */ | 1619 | /* sleep if not ready to read */ |
1620 | set_current_state(TASK_INTERRUPTIBLE); | 1620 | schedule_timeout_interruptible(1); |
1621 | schedule_timeout(1); | ||
1622 | } | 1621 | } |
1623 | printk(KERN_INFO "cosa: timeout in get_wait_data (status 0x%x)\n", | 1622 | printk(KERN_INFO "cosa: timeout in get_wait_data (status 0x%x)\n", |
1624 | cosa_getstatus(cosa)); | 1623 | cosa_getstatus(cosa)); |
@@ -1644,8 +1643,7 @@ static int put_wait_data(struct cosa_data *cosa, int data) | |||
1644 | } | 1643 | } |
1645 | #if 0 | 1644 | #if 0 |
1646 | /* sleep if not ready to read */ | 1645 | /* sleep if not ready to read */ |
1647 | current->state = TASK_INTERRUPTIBLE; | 1646 | schedule_timeout_interruptible(1); |
1648 | schedule_timeout(1); | ||
1649 | #endif | 1647 | #endif |
1650 | } | 1648 | } |
1651 | printk(KERN_INFO "cosa%d: timeout in put_wait_data (status 0x%x)\n", | 1649 | printk(KERN_INFO "cosa%d: timeout in put_wait_data (status 0x%x)\n", |
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c index 520a77a798e2..0c1ab4ac8bdb 100644 --- a/drivers/net/wan/dscc4.c +++ b/drivers/net/wan/dscc4.c | |||
@@ -542,8 +542,7 @@ static int dscc4_wait_ack_cec(struct dscc4_dev_priv *dpriv, | |||
542 | msg, i); | 542 | msg, i); |
543 | goto done; | 543 | goto done; |
544 | } | 544 | } |
545 | set_current_state(TASK_UNINTERRUPTIBLE); | 545 | schedule_timeout_uninterruptible(10); |
546 | schedule_timeout(10); | ||
547 | rmb(); | 546 | rmb(); |
548 | } while (++i > 0); | 547 | } while (++i > 0); |
549 | printk(KERN_ERR "%s: %s timeout\n", dev->name, msg); | 548 | printk(KERN_ERR "%s: %s timeout\n", dev->name, msg); |
@@ -588,8 +587,7 @@ static inline int dscc4_xpr_ack(struct dscc4_dev_priv *dpriv) | |||
588 | (dpriv->iqtx[cur] & Xpr)) | 587 | (dpriv->iqtx[cur] & Xpr)) |
589 | break; | 588 | break; |
590 | smp_rmb(); | 589 | smp_rmb(); |
591 | set_current_state(TASK_UNINTERRUPTIBLE); | 590 | schedule_timeout_uninterruptible(10); |
592 | schedule_timeout(10); | ||
593 | } while (++i > 0); | 591 | } while (++i > 0); |
594 | 592 | ||
595 | return (i >= 0 ) ? i : -EAGAIN; | 593 | return (i >= 0 ) ? i : -EAGAIN; |
@@ -1035,8 +1033,7 @@ static void dscc4_pci_reset(struct pci_dev *pdev, void __iomem *ioaddr) | |||
1035 | /* Flush posted writes */ | 1033 | /* Flush posted writes */ |
1036 | readl(ioaddr + GSTAR); | 1034 | readl(ioaddr + GSTAR); |
1037 | 1035 | ||
1038 | set_current_state(TASK_UNINTERRUPTIBLE); | 1036 | schedule_timeout_uninterruptible(10); |
1039 | schedule_timeout(10); | ||
1040 | 1037 | ||
1041 | for (i = 0; i < 16; i++) | 1038 | for (i = 0; i < 16; i++) |
1042 | pci_write_config_dword(pdev, i << 2, dscc4_pci_config_store[i]); | 1039 | pci_write_config_dword(pdev, i << 2, dscc4_pci_config_store[i]); |
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index 2c83cca34b86..10befb02d768 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c | |||
@@ -980,8 +980,7 @@ fst_issue_cmd(struct fst_port_info *port, unsigned short cmd) | |||
980 | /* Wait for any previous command to complete */ | 980 | /* Wait for any previous command to complete */ |
981 | while (mbval > NAK) { | 981 | while (mbval > NAK) { |
982 | spin_unlock_irqrestore(&card->card_lock, flags); | 982 | spin_unlock_irqrestore(&card->card_lock, flags); |
983 | set_current_state(TASK_UNINTERRUPTIBLE); | 983 | schedule_timeout_uninterruptible(1); |
984 | schedule_timeout(1); | ||
985 | spin_lock_irqsave(&card->card_lock, flags); | 984 | spin_lock_irqsave(&card->card_lock, flags); |
986 | 985 | ||
987 | if (++safety > 2000) { | 986 | if (++safety > 2000) { |