staging: panel: use schedule_timeout_interruptible()
authorNicholas Mc Guire <hofrat@osadl.org>
Fri, 29 May 2015 17:02:32 +0000 (19:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 May 2015 03:04:36 +0000 (12:04 +0900)
API consolidation with coccinelle found:
./drivers/staging/panel/panel.c:782:2-18:
        consolidation with schedule_timeout_*() recommended

This is a 1:1 conversion with respect to schedule_timeout() to the
schedule_timeout_interruptible() helper only - so only an API
consolidation to improve readability. The timeout was being passed
as (ms * HZ + 999) / 1000 but that simply looks wrong - rather than
"manual" converting to jiffies, msecs_to_jiffies which handles all
corner-cases correctly, was used.

Patch was compile tested with x86_64_defconfig + CONFIG_STAGING=y,
CONFIG_PARPORT=m, CONFIG_PANEL=m

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/panel/panel.c

index 0046ee0af8b952bf2793649bb343c1d821c4bdd7..d670494552531170366d91b266e4501a775a1327 100644 (file)
@@ -775,12 +775,10 @@ static void pin_to_bits(int pin, unsigned char *d_val, unsigned char *c_val)
 /* sleeps that many milliseconds with a reschedule */
 static void long_sleep(int ms)
 {
-       if (in_interrupt()) {
+       if (in_interrupt())
                mdelay(ms);
-       } else {
-               __set_current_state(TASK_INTERRUPTIBLE);
-               schedule_timeout((ms * HZ + 999) / 1000);
-       }
+       else
+               schedule_timeout_interruptible(msecs_to_jiffies(ms));
 }
 
 /* send a serial byte to the LCD panel. The caller is responsible for locking