[PATCH] serial: fix-up schedule_timeout() usage
Use schedule_timeout_uninterruptible() instead of set_current_state()/schedule_timeout() to reduce kernel size. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
a9a3047dd8
commit
3c76bc5bfd
|
@ -4416,10 +4416,8 @@ rs_close(struct tty_struct *tty, struct file * filp)
|
||||||
info->event = 0;
|
info->event = 0;
|
||||||
info->tty = 0;
|
info->tty = 0;
|
||||||
if (info->blocked_open) {
|
if (info->blocked_open) {
|
||||||
if (info->close_delay) {
|
if (info->close_delay)
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
schedule_timeout_interruptible(info->close_delay);
|
||||||
schedule_timeout(info->close_delay);
|
|
||||||
}
|
|
||||||
wake_up_interruptible(&info->open_wait);
|
wake_up_interruptible(&info->open_wait);
|
||||||
}
|
}
|
||||||
info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
|
info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
|
||||||
|
@ -4469,8 +4467,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
|
||||||
while (info->xmit.head != info->xmit.tail || /* More in send queue */
|
while (info->xmit.head != info->xmit.tail || /* More in send queue */
|
||||||
(*info->ostatusadr & 0x007f) || /* more in FIFO */
|
(*info->ostatusadr & 0x007f) || /* more in FIFO */
|
||||||
(elapsed_usec < 2*info->char_time_usec)) {
|
(elapsed_usec < 2*info->char_time_usec)) {
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
schedule_timeout_interruptible(1);
|
||||||
schedule_timeout(1);
|
|
||||||
if (signal_pending(current))
|
if (signal_pending(current))
|
||||||
break;
|
break;
|
||||||
if (timeout && time_after(jiffies, orig_jiffies + timeout))
|
if (timeout && time_after(jiffies, orig_jiffies + timeout))
|
||||||
|
|
Loading…
Reference in New Issue