[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>
This commit is contained in:
committed by
Linus Torvalds
parent
8b93ec77a6
commit
6521018d4b
@@ -511,7 +511,7 @@ mpt_lan_close(struct net_device *dev)
|
|||||||
{
|
{
|
||||||
struct mpt_lan_priv *priv = netdev_priv(dev);
|
struct mpt_lan_priv *priv = netdev_priv(dev);
|
||||||
MPT_ADAPTER *mpt_dev = priv->mpt_dev;
|
MPT_ADAPTER *mpt_dev = priv->mpt_dev;
|
||||||
unsigned int timeout;
|
unsigned long timeout;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
dlprintk((KERN_INFO MYNAM ": mpt_lan_close called\n"));
|
dlprintk((KERN_INFO MYNAM ": mpt_lan_close called\n"));
|
||||||
@@ -526,11 +526,9 @@ mpt_lan_close(struct net_device *dev)
|
|||||||
|
|
||||||
mpt_lan_reset(dev);
|
mpt_lan_reset(dev);
|
||||||
|
|
||||||
timeout = 2 * HZ;
|
timeout = jiffies + 2 * HZ;
|
||||||
while (atomic_read(&priv->buckets_out) && --timeout) {
|
while (atomic_read(&priv->buckets_out) && time_before(jiffies, timeout))
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
schedule_timeout_interruptible(1);
|
||||||
schedule_timeout(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < priv->max_buckets_out; i++) {
|
for (i = 0; i < priv->max_buckets_out; i++) {
|
||||||
if (priv->RcvCtl[i].skb != NULL) {
|
if (priv->RcvCtl[i].skb != NULL) {
|
||||||
|
@@ -1013,10 +1013,8 @@ mptscsih_remove(struct pci_dev *pdev)
|
|||||||
spin_lock_irqsave(&dvtaskQ_lock, flags);
|
spin_lock_irqsave(&dvtaskQ_lock, flags);
|
||||||
if (dvtaskQ_active) {
|
if (dvtaskQ_active) {
|
||||||
spin_unlock_irqrestore(&dvtaskQ_lock, flags);
|
spin_unlock_irqrestore(&dvtaskQ_lock, flags);
|
||||||
while(dvtaskQ_active && --count) {
|
while(dvtaskQ_active && --count)
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
schedule_timeout_interruptible(1);
|
||||||
schedule_timeout(1);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
spin_unlock_irqrestore(&dvtaskQ_lock, flags);
|
spin_unlock_irqrestore(&dvtaskQ_lock, flags);
|
||||||
}
|
}
|
||||||
|
@@ -93,8 +93,7 @@ u32 i2o_msg_get_wait(struct i2o_controller *c,
|
|||||||
c->name);
|
c->name);
|
||||||
return I2O_QUEUE_EMPTY;
|
return I2O_QUEUE_EMPTY;
|
||||||
}
|
}
|
||||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
schedule_timeout_uninterruptible(1);
|
||||||
schedule_timeout(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
@@ -485,8 +484,7 @@ static int i2o_iop_init_outbound_queue(struct i2o_controller *c)
|
|||||||
osm_warn("%s: Timeout Initializing\n", c->name);
|
osm_warn("%s: Timeout Initializing\n", c->name);
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
schedule_timeout_uninterruptible(1);
|
||||||
schedule_timeout(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m = c->out_queue.phys;
|
m = c->out_queue.phys;
|
||||||
@@ -548,8 +546,7 @@ static int i2o_iop_reset(struct i2o_controller *c)
|
|||||||
if (time_after(jiffies, timeout))
|
if (time_after(jiffies, timeout))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
schedule_timeout_uninterruptible(1);
|
||||||
schedule_timeout(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (*status) {
|
switch (*status) {
|
||||||
@@ -577,8 +574,7 @@ static int i2o_iop_reset(struct i2o_controller *c)
|
|||||||
rc = -ETIMEDOUT;
|
rc = -ETIMEDOUT;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
schedule_timeout_uninterruptible(1);
|
||||||
schedule_timeout(1);
|
|
||||||
|
|
||||||
m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET);
|
m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET);
|
||||||
}
|
}
|
||||||
@@ -989,8 +985,7 @@ int i2o_status_get(struct i2o_controller *c)
|
|||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
schedule_timeout_uninterruptible(1);
|
||||||
schedule_timeout(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
Reference in New Issue
Block a user