aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2005-11-07 04:01:19 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:53:57 -0500
commit6521018d4bf9522b4de47254ea15e8c1be1ec00f (patch)
tree352f6b9cc56018c584042c44502288599aed60ca /drivers
parent8b93ec77a6423cc57189561567ee41fa7fa1f5b6 (diff)
[PATCH] message: 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: "Moore, Eric Dean" <Eric.Moore@lsil.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/message/fusion/mptlan.c10
-rw-r--r--drivers/message/fusion/mptscsih.c6
-rw-r--r--drivers/message/i2o/iop.c15
3 files changed, 11 insertions, 20 deletions
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c
index ed3c891e388f..014085d8ec85 100644
--- a/drivers/message/fusion/mptlan.c
+++ b/drivers/message/fusion/mptlan.c
@@ -511,7 +511,7 @@ mpt_lan_close(struct net_device *dev)
511{ 511{
512 struct mpt_lan_priv *priv = netdev_priv(dev); 512 struct mpt_lan_priv *priv = netdev_priv(dev);
513 MPT_ADAPTER *mpt_dev = priv->mpt_dev; 513 MPT_ADAPTER *mpt_dev = priv->mpt_dev;
514 unsigned int timeout; 514 unsigned long timeout;
515 int i; 515 int i;
516 516
517 dlprintk((KERN_INFO MYNAM ": mpt_lan_close called\n")); 517 dlprintk((KERN_INFO MYNAM ": mpt_lan_close called\n"));
@@ -526,11 +526,9 @@ mpt_lan_close(struct net_device *dev)
526 526
527 mpt_lan_reset(dev); 527 mpt_lan_reset(dev);
528 528
529 timeout = 2 * HZ; 529 timeout = jiffies + 2 * HZ;
530 while (atomic_read(&priv->buckets_out) && --timeout) { 530 while (atomic_read(&priv->buckets_out) && time_before(jiffies, timeout))
531 set_current_state(TASK_INTERRUPTIBLE); 531 schedule_timeout_interruptible(1);
532 schedule_timeout(1);
533 }
534 532
535 for (i = 0; i < priv->max_buckets_out; i++) { 533 for (i = 0; i < priv->max_buckets_out; i++) {
536 if (priv->RcvCtl[i].skb != NULL) { 534 if (priv->RcvCtl[i].skb != NULL) {
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 5cb07eb224d7..4330ed0cedaa 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1013,10 +1013,8 @@ mptscsih_remove(struct pci_dev *pdev)
1013 spin_lock_irqsave(&dvtaskQ_lock, flags); 1013 spin_lock_irqsave(&dvtaskQ_lock, flags);
1014 if (dvtaskQ_active) { 1014 if (dvtaskQ_active) {
1015 spin_unlock_irqrestore(&dvtaskQ_lock, flags); 1015 spin_unlock_irqrestore(&dvtaskQ_lock, flags);
1016 while(dvtaskQ_active && --count) { 1016 while(dvtaskQ_active && --count)
1017 set_current_state(TASK_INTERRUPTIBLE); 1017 schedule_timeout_interruptible(1);
1018 schedule_timeout(1);
1019 }
1020 } else { 1018 } else {
1021 spin_unlock_irqrestore(&dvtaskQ_lock, flags); 1019 spin_unlock_irqrestore(&dvtaskQ_lock, flags);
1022 } 1020 }
diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c
index 61b837de4b6a..4eb53258842e 100644
--- a/drivers/message/i2o/iop.c
+++ b/drivers/message/i2o/iop.c
@@ -93,8 +93,7 @@ u32 i2o_msg_get_wait(struct i2o_controller *c,
93 c->name); 93 c->name);
94 return I2O_QUEUE_EMPTY; 94 return I2O_QUEUE_EMPTY;
95 } 95 }
96 set_current_state(TASK_UNINTERRUPTIBLE); 96 schedule_timeout_uninterruptible(1);
97 schedule_timeout(1);
98 } 97 }
99 98
100 return m; 99 return m;
@@ -485,8 +484,7 @@ static int i2o_iop_init_outbound_queue(struct i2o_controller *c)
485 osm_warn("%s: Timeout Initializing\n", c->name); 484 osm_warn("%s: Timeout Initializing\n", c->name);
486 return -ETIMEDOUT; 485 return -ETIMEDOUT;
487 } 486 }
488 set_current_state(TASK_UNINTERRUPTIBLE); 487 schedule_timeout_uninterruptible(1);
489 schedule_timeout(1);
490 } 488 }
491 489
492 m = c->out_queue.phys; 490 m = c->out_queue.phys;
@@ -548,8 +546,7 @@ static int i2o_iop_reset(struct i2o_controller *c)
548 if (time_after(jiffies, timeout)) 546 if (time_after(jiffies, timeout))
549 break; 547 break;
550 548
551 set_current_state(TASK_UNINTERRUPTIBLE); 549 schedule_timeout_uninterruptible(1);
552 schedule_timeout(1);
553 } 550 }
554 551
555 switch (*status) { 552 switch (*status) {
@@ -577,8 +574,7 @@ static int i2o_iop_reset(struct i2o_controller *c)
577 rc = -ETIMEDOUT; 574 rc = -ETIMEDOUT;
578 goto exit; 575 goto exit;
579 } 576 }
580 set_current_state(TASK_UNINTERRUPTIBLE); 577 schedule_timeout_uninterruptible(1);
581 schedule_timeout(1);
582 578
583 m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET); 579 m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET);
584 } 580 }
@@ -989,8 +985,7 @@ int i2o_status_get(struct i2o_controller *c)
989 return -ETIMEDOUT; 985 return -ETIMEDOUT;
990 } 986 }
991 987
992 set_current_state(TASK_UNINTERRUPTIBLE); 988 schedule_timeout_uninterruptible(1);
993 schedule_timeout(1);
994 } 989 }
995 990
996#ifdef DEBUG 991#ifdef DEBUG