Commit e5de3dfc391cceff6a4a3a0bb9c9c349a2e7c275
Committed by
Takashi Iwai
1 parent
2232e23829
Exists in
master
and in
4 other branches
sound: oss: waveartist: simplify waveartist_sleep()
waveartist_sleep() uses loop with schedule_timeout() to unconditionally wait for msec. Use schedule_timeout_uninteruptible() instead. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Showing 1 changed file with 2 additions and 8 deletions Side-by-side Diff
sound/oss/waveartist.c
... | ... | @@ -184,14 +184,8 @@ |
184 | 184 | static inline int |
185 | 185 | waveartist_sleep(int timeout_ms) |
186 | 186 | { |
187 | - unsigned int timeout = timeout_ms * 10 * HZ / 100; | |
188 | - | |
189 | - do { | |
190 | - set_current_state(TASK_INTERRUPTIBLE); | |
191 | - timeout = schedule_timeout(timeout); | |
192 | - } while (timeout); | |
193 | - | |
194 | - return 0; | |
187 | + unsigned int timeout = msecs_to_jiffies(timeout_ms*100); | |
188 | + return schedule_timeout_interruptible(timeout); | |
195 | 189 | } |
196 | 190 | |
197 | 191 | static int |