* [KJ] [PATCH 32/33] sound/rawmidi: replace
@ 2005-01-26 0:47 Nishanth Aravamudan
0 siblings, 0 replies; only message in thread
From: Nishanth Aravamudan @ 2005-01-26 0:47 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]
Hi,
Please consider applying.
Description: Use wai_event_interruptible_timeout() instead of
deprecated interruptible_sleep_on_timeout(). Patch is compile-tested.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
--- 2.6.11-rc2-kj-v/sound/core/rawmidi.c 2005-01-25 16:45:12.000000000 -0800
+++ 2.6.11-rc2-kj/sound/core/rawmidi.c 2005-01-24 17:22:36.000000000 -0800
@@ -30,6 +30,7 @@
#include <linux/wait.h>
#include <linux/moduleparam.h>
#include <linux/delay.h>
+#include <linux/wait.h>
#include <sound/rawmidi.h>
#include <sound/info.h>
#include <sound/control.h>
@@ -133,17 +134,14 @@ int snd_rawmidi_drain_output(snd_rawmidi
err = 0;
runtime->drain = 1;
- while (runtime->avail < runtime->buffer_size) {
- timeout = interruptible_sleep_on_timeout(&runtime->sleep, 10 * HZ);
- if (signal_pending(current)) {
- err = -ERESTARTSYS;
- break;
- }
- if (runtime->avail < runtime->buffer_size && !timeout) {
- snd_printk(KERN_WARNING "rawmidi drain error (avail = %li, buffer_size = %li)\n", (long)runtime->avail, (long)runtime->buffer_size);
- err = -EIO;
- break;
- }
+ timeout = wait_event_interruptible_timeout(runtime->sleep,
+ (runtime->avail >= runtime->buffer_size),
+ 10*HZ);
+ if (signal_pending(current))
+ err = -ERESTARTSYS;
+ if (runtime->avail < runtime->buffer_size && !timeout) {
+ snd_printk(KERN_WARNING "rawmidi drain error (avail = %li, buffer_size = %li)\n", (long)runtime->avail, (long)runtime->buffer_size);
+ err = -EIO;
}
runtime->drain = 0;
if (err != -ERESTARTSYS) {
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-01-26 0:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-26 0:47 [KJ] [PATCH 32/33] sound/rawmidi: replace Nishanth Aravamudan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).