drivers/staging: use current->state helpers
authorDavidlohr Bueso <dave@stgolabs.net>
Mon, 26 Jan 2015 10:15:02 +0000 (02:15 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jan 2015 19:25:28 +0000 (11:25 -0800)
Call __set_current_state() instead of assigning the new state directly.
These interfaces also aid CONFIG_DEBUG_ATOMIC_SLEEP environments,
keeping track of who changed the state.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/me_daq.c
drivers/staging/dgnc/dgnc_utils.c
drivers/staging/panel/panel.c
drivers/staging/speakup/selection.c
drivers/staging/unisys/include/timskmod.h

index bffc161155107832a066e09a094b50efcfcda751..92e23527f2cb3c09703197450a2a399f6eff867e 100644 (file)
@@ -174,7 +174,7 @@ struct me_private_data {
 
 static inline void sleep(unsigned sec)
 {
-       current->state = TASK_INTERRUPTIBLE;
+       __set_current_state(TASK_INTERRUPTIBLE);
        schedule_timeout(sec * HZ);
 }
 
index 61efc13ec160fc6f0e3d45915669763779cd4311..80b51332292cfe6bebf5198d21a6cf14c9b051d1 100644 (file)
@@ -12,7 +12,7 @@
  */
 int dgnc_ms_sleep(ulong ms)
 {
-       current->state = TASK_INTERRUPTIBLE;
+       __set_current_state(TASK_INTERRUPTIBLE);
        schedule_timeout((ms * HZ) / 1000);
        return signal_pending(current);
 }
index 9c68ccf05bdf6045a0e0e603c67b26648682e236..6ed35b6ecf0d1a3bf2795d4dd5d01678aa365bf7 100644 (file)
@@ -780,7 +780,7 @@ static void long_sleep(int ms)
        if (in_interrupt()) {
                mdelay(ms);
        } else {
-               current->state = TASK_INTERRUPTIBLE;
+               __set_current_state(TASK_INTERRUPTIBLE);
                schedule_timeout((ms * HZ + 999) / 1000);
        }
 }
index 507fc9a1776e4a8e1532d9522d2f3560baa5a29e..a0315701c7d96ec7ca506ab08400b66823cface1 100644 (file)
@@ -157,7 +157,7 @@ static void __speakup_paste_selection(struct work_struct *work)
                pasted += count;
        }
        remove_wait_queue(&vc->paste_wait, &wait);
-       current->state = TASK_RUNNING;
+       __set_current_state(TASK_RUNNING);
 
        tty_buffer_unlock_exclusive(&vc->port);
        tty_ldisc_deref(ld);
index cff7983dab85d89a7be1e7f239d76093dbfbd892..4019a0d63645fe53380caec301679a68f9979e87 100644 (file)
  *  x - the number of seconds to sleep.
  */
 #define SLEEP(x)                                            \
-       do { current->state = TASK_INTERRUPTIBLE;            \
+       do { __set_current_state(TASK_INTERRUPTIBLE);        \
                schedule_timeout((x)*HZ);                    \
        } while (0)
 
  *  x - the number of jiffies to sleep.
  */
 #define SLEEPJIFFIES(x)                                                    \
-       do { current->state = TASK_INTERRUPTIBLE;                   \
+       do { __set_current_state(TASK_INTERRUPTIBLE);               \
                schedule_timeout(x);                                \
        } while (0)