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

Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]>

---

 drivers/usb/class/audio.c       |   12 ++++++++----
 drivers/usb/host/ehci-hcd.c     |    3 +--
 drivers/usb/host/ohci-hcd.c     |    3 +--
 drivers/usb/serial/cypress_m8.c |    3 +--
 drivers/usb/serial/pl2303.c     |    3 +--
 5 files changed, 12 insertions(+), 12 deletions(-)

diff -urpN 2.6.13-rc5-mm1/drivers/usb/class/audio.c 
2.6.13-rc5-mm1-dev/drivers/usb/class/audio.c
--- 2.6.13-rc5-mm1/drivers/usb/class/audio.c    2005-08-07 09:57:36.000000000 
-0700
+++ 2.6.13-rc5-mm1-dev/drivers/usb/class/audio.c        2005-08-10 
14:30:46.000000000 -0700
@@ -631,8 +631,10 @@ static void usbin_stop(struct usb_audiod
        i = u->flags;
        spin_unlock_irqrestore(&as->lock, flags);
        while (i & 
(FLG_URB0RUNNING|FLG_URB1RUNNING|FLG_SYNC0RUNNING|FLG_SYNC1RUNNING)) {
-               set_current_state(notkilled ? TASK_INTERRUPTIBLE : 
TASK_UNINTERRUPTIBLE);
-               schedule_timeout(1);
+               if (notkilled)
+                       schedule_timeout_interruptible(1);
+               else
+                       schedule_timeout_uninterruptible(1);
                spin_lock_irqsave(&as->lock, flags);
                i = u->flags;
                spin_unlock_irqrestore(&as->lock, flags);
@@ -1102,8 +1104,10 @@ static void usbout_stop(struct usb_audio
        i = u->flags;
        spin_unlock_irqrestore(&as->lock, flags);
        while (i & 
(FLG_URB0RUNNING|FLG_URB1RUNNING|FLG_SYNC0RUNNING|FLG_SYNC1RUNNING)) {
-               set_current_state(notkilled ? TASK_INTERRUPTIBLE : 
TASK_UNINTERRUPTIBLE);
-               schedule_timeout(1);
+               if (not_killed)
+                       schedule_timeout_interruptible(1);
+               else
+                       schedule_timeout_uninterruptible(1);
                spin_lock_irqsave(&as->lock, flags);
                i = u->flags;
                spin_unlock_irqrestore(&as->lock, flags);
diff -urpN 2.6.13-rc5-mm1/drivers/usb/host/ehci-hcd.c 
2.6.13-rc5-mm1-dev/drivers/usb/host/ehci-hcd.c
--- 2.6.13-rc5-mm1/drivers/usb/host/ehci-hcd.c  2005-08-07 09:58:14.000000000 
-0700
+++ 2.6.13-rc5-mm1-dev/drivers/usb/host/ehci-hcd.c      2005-08-10 
16:07:07.000000000 -0700
@@ -1124,8 +1124,7 @@ rescan:
        case QH_STATE_UNLINK:           /* wait for hw to finish? */
 idle_timeout:
                spin_unlock_irqrestore (&ehci->lock, flags);
-               set_current_state (TASK_UNINTERRUPTIBLE);
-               schedule_timeout (1);
+               schedule_timeout_uninterruptible(1);
                goto rescan;
        case QH_STATE_IDLE:             /* fully unlinked */
                if (list_empty (&qh->qtd_list)) {
diff -urpN 2.6.13-rc5-mm1/drivers/usb/host/ohci-hcd.c 
2.6.13-rc5-mm1-dev/drivers/usb/host/ohci-hcd.c
--- 2.6.13-rc5-mm1/drivers/usb/host/ohci-hcd.c  2005-08-07 09:58:14.000000000 
-0700
+++ 2.6.13-rc5-mm1-dev/drivers/usb/host/ohci-hcd.c      2005-08-10 
14:51:53.000000000 -0700
@@ -382,8 +382,7 @@ sanitize:
                        goto sanitize;
                }
                spin_unlock_irqrestore (&ohci->lock, flags);
-               set_current_state (TASK_UNINTERRUPTIBLE);
-               schedule_timeout (1);
+               schedule_timeout_uninterruptible(1);
                goto rescan;
        case ED_IDLE:           /* fully unlinked */
                if (list_empty (&ed->td_list)) {
diff -urpN 2.6.13-rc5-mm1/drivers/usb/serial/cypress_m8.c 
2.6.13-rc5-mm1-dev/drivers/usb/serial/cypress_m8.c
--- 2.6.13-rc5-mm1/drivers/usb/serial/cypress_m8.c      2005-08-07 
10:05:21.000000000 -0700
+++ 2.6.13-rc5-mm1-dev/drivers/usb/serial/cypress_m8.c  2005-08-10 
14:52:10.000000000 -0700
@@ -610,8 +610,7 @@ static void cypress_close(struct usb_ser
                timeout = max((HZ*2560)/bps,HZ/10);
        else
                timeout = 2*HZ;
-       set_current_state(TASK_INTERRUPTIBLE);
-       schedule_timeout(timeout);
+       schedule_timeout_interruptible(timeout);
 
        dbg("%s - stopping urbs", __FUNCTION__);
        usb_kill_urb (port->interrupt_in_urb);
diff -urpN 2.6.13-rc5-mm1/drivers/usb/serial/pl2303.c 
2.6.13-rc5-mm1-dev/drivers/usb/serial/pl2303.c
--- 2.6.13-rc5-mm1/drivers/usb/serial/pl2303.c  2005-08-07 09:57:36.000000000 
-0700
+++ 2.6.13-rc5-mm1-dev/drivers/usb/serial/pl2303.c      2005-08-10 
14:52:32.000000000 -0700
@@ -650,8 +650,7 @@ static void pl2303_close (struct usb_ser
                timeout = max((HZ*2560)/bps,HZ/10);
        else
                timeout = 2*HZ;
-       set_current_state(TASK_INTERRUPTIBLE);
-       schedule_timeout(timeout);
+       schedule_timeout_interruptible(timeout);
 
        /* shutdown our urbs */
        dbg("%s - shutting down urbs", __FUNCTION__);


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to