Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] drivers/usb: fix-up schedule_timeout() usage

Description: Use schedule_timeout_{,un}interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Nishanth Aravamudan and committed by
Greg Kroah-Hartman
22c43863 dd16525b

+12 -12
+8 -4
drivers/usb/class/audio.c
··· 631 631 i = u->flags; 632 632 spin_unlock_irqrestore(&as->lock, flags); 633 633 while (i & (FLG_URB0RUNNING|FLG_URB1RUNNING|FLG_SYNC0RUNNING|FLG_SYNC1RUNNING)) { 634 - set_current_state(notkilled ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); 635 - schedule_timeout(1); 634 + if (notkilled) 635 + schedule_timeout_interruptible(1); 636 + else 637 + schedule_timeout_uninterruptible(1); 636 638 spin_lock_irqsave(&as->lock, flags); 637 639 i = u->flags; 638 640 spin_unlock_irqrestore(&as->lock, flags); ··· 1104 1102 i = u->flags; 1105 1103 spin_unlock_irqrestore(&as->lock, flags); 1106 1104 while (i & (FLG_URB0RUNNING|FLG_URB1RUNNING|FLG_SYNC0RUNNING|FLG_SYNC1RUNNING)) { 1107 - set_current_state(notkilled ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); 1108 - schedule_timeout(1); 1105 + if (notkilled) 1106 + schedule_timeout_interruptible(1); 1107 + else 1108 + schedule_timeout_uninterruptible(1); 1109 1109 spin_lock_irqsave(&as->lock, flags); 1110 1110 i = u->flags; 1111 1111 spin_unlock_irqrestore(&as->lock, flags);
+1 -2
drivers/usb/host/ehci-hcd.c
··· 1147 1147 case QH_STATE_UNLINK: /* wait for hw to finish? */ 1148 1148 idle_timeout: 1149 1149 spin_unlock_irqrestore (&ehci->lock, flags); 1150 - set_current_state (TASK_UNINTERRUPTIBLE); 1151 - schedule_timeout (1); 1150 + schedule_timeout_uninterruptible(1); 1152 1151 goto rescan; 1153 1152 case QH_STATE_IDLE: /* fully unlinked */ 1154 1153 if (list_empty (&qh->qtd_list)) {
+1 -2
drivers/usb/host/ohci-hcd.c
··· 382 382 goto sanitize; 383 383 } 384 384 spin_unlock_irqrestore (&ohci->lock, flags); 385 - set_current_state (TASK_UNINTERRUPTIBLE); 386 - schedule_timeout (1); 385 + schedule_timeout_uninterruptible(1); 387 386 goto rescan; 388 387 case ED_IDLE: /* fully unlinked */ 389 388 if (list_empty (&ed->td_list)) {
+1 -2
drivers/usb/serial/cypress_m8.c
··· 610 610 timeout = max((HZ*2560)/bps,HZ/10); 611 611 else 612 612 timeout = 2*HZ; 613 - set_current_state(TASK_INTERRUPTIBLE); 614 - schedule_timeout(timeout); 613 + schedule_timeout_interruptible(timeout); 615 614 616 615 dbg("%s - stopping urbs", __FUNCTION__); 617 616 usb_kill_urb (port->interrupt_in_urb);
+1 -2
drivers/usb/serial/pl2303.c
··· 652 652 timeout = max((HZ*2560)/bps,HZ/10); 653 653 else 654 654 timeout = 2*HZ; 655 - set_current_state(TASK_INTERRUPTIBLE); 656 - schedule_timeout(timeout); 655 + schedule_timeout_interruptible(timeout); 657 656 658 657 /* shutdown our urbs */ 659 658 dbg("%s - shutting down urbs", __FUNCTION__);