diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-10-24 09:02:37 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-11-04 07:19:49 -0500 |
commit | 8433a509c0eb6bb1f33ce39c82c580b8901619ee (patch) | |
tree | f1554905dee5da4e840dfd674d5b004124496a22 /sound/core | |
parent | d78bec210f07b06f406b877b9179e0cc281ae8e6 (diff) |
[ALSA] Fix schedule_timeout usage
Use schedule_timeout_{,un}interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size. Also use
human-time conversion functions instead of hard-coded division to avoid
rounding issues.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/seq/seq_instr.c | 12 | ||||
-rw-r--r-- | sound/core/seq/seq_lock.c | 3 | ||||
-rw-r--r-- | sound/core/seq/seq_memory.c | 3 |
3 files changed, 6 insertions, 12 deletions
diff --git a/sound/core/seq/seq_instr.c b/sound/core/seq/seq_instr.c index 019d43a462d7..1d525b13ebb6 100644 --- a/sound/core/seq/seq_instr.c +++ b/sound/core/seq/seq_instr.c | |||
@@ -109,8 +109,7 @@ void snd_seq_instr_list_free(snd_seq_kinstr_list_t **list_ptr) | |||
109 | spin_lock_irqsave(&list->lock, flags); | 109 | spin_lock_irqsave(&list->lock, flags); |
110 | while (instr->use) { | 110 | while (instr->use) { |
111 | spin_unlock_irqrestore(&list->lock, flags); | 111 | spin_unlock_irqrestore(&list->lock, flags); |
112 | set_current_state(TASK_INTERRUPTIBLE); | 112 | schedule_timeout_interruptible(1); |
113 | schedule_timeout(1); | ||
114 | spin_lock_irqsave(&list->lock, flags); | 113 | spin_lock_irqsave(&list->lock, flags); |
115 | } | 114 | } |
116 | spin_unlock_irqrestore(&list->lock, flags); | 115 | spin_unlock_irqrestore(&list->lock, flags); |
@@ -199,10 +198,8 @@ int snd_seq_instr_list_free_cond(snd_seq_kinstr_list_t *list, | |||
199 | while (flist) { | 198 | while (flist) { |
200 | instr = flist; | 199 | instr = flist; |
201 | flist = instr->next; | 200 | flist = instr->next; |
202 | while (instr->use) { | 201 | while (instr->use) |
203 | set_current_state(TASK_INTERRUPTIBLE); | 202 | schedule_timeout_interruptible(1); |
204 | schedule_timeout(1); | ||
205 | } | ||
206 | if (snd_seq_instr_free(instr, atomic)<0) | 203 | if (snd_seq_instr_free(instr, atomic)<0) |
207 | snd_printk(KERN_WARNING "instrument free problem\n"); | 204 | snd_printk(KERN_WARNING "instrument free problem\n"); |
208 | instr = next; | 205 | instr = next; |
@@ -554,8 +551,7 @@ static int instr_free(snd_seq_kinstr_ops_t *ops, | |||
554 | instr->ops->notify(instr->ops->private_data, instr, SNDRV_SEQ_INSTR_NOTIFY_REMOVE); | 551 | instr->ops->notify(instr->ops->private_data, instr, SNDRV_SEQ_INSTR_NOTIFY_REMOVE); |
555 | while (instr->use) { | 552 | while (instr->use) { |
556 | spin_unlock_irqrestore(&list->lock, flags); | 553 | spin_unlock_irqrestore(&list->lock, flags); |
557 | set_current_state(TASK_INTERRUPTIBLE); | 554 | schedule_timeout_interruptible(1); |
558 | schedule_timeout(1); | ||
559 | spin_lock_irqsave(&list->lock, flags); | 555 | spin_lock_irqsave(&list->lock, flags); |
560 | } | 556 | } |
561 | spin_unlock_irqrestore(&list->lock, flags); | 557 | spin_unlock_irqrestore(&list->lock, flags); |
diff --git a/sound/core/seq/seq_lock.c b/sound/core/seq/seq_lock.c index b09cee058fa7..a837a94b2d2a 100644 --- a/sound/core/seq/seq_lock.c +++ b/sound/core/seq/seq_lock.c | |||
@@ -39,8 +39,7 @@ void snd_use_lock_sync_helper(snd_use_lock_t *lockp, const char *file, int line) | |||
39 | snd_printk(KERN_WARNING "seq_lock: timeout [%d left] in %s:%d\n", atomic_read(lockp), file, line); | 39 | snd_printk(KERN_WARNING "seq_lock: timeout [%d left] in %s:%d\n", atomic_read(lockp), file, line); |
40 | break; | 40 | break; |
41 | } | 41 | } |
42 | set_current_state(TASK_UNINTERRUPTIBLE); | 42 | schedule_timeout_uninterruptible(1); |
43 | schedule_timeout(1); | ||
44 | max_count--; | 43 | max_count--; |
45 | } | 44 | } |
46 | } | 45 | } |
diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c index d4d7d326c4b1..8416bcffa091 100644 --- a/sound/core/seq/seq_memory.c +++ b/sound/core/seq/seq_memory.c | |||
@@ -423,8 +423,7 @@ int snd_seq_pool_done(pool_t *pool) | |||
423 | snd_printk(KERN_WARNING "snd_seq_pool_done timeout: %d cells remain\n", atomic_read(&pool->counter)); | 423 | snd_printk(KERN_WARNING "snd_seq_pool_done timeout: %d cells remain\n", atomic_read(&pool->counter)); |
424 | break; | 424 | break; |
425 | } | 425 | } |
426 | set_current_state(TASK_UNINTERRUPTIBLE); | 426 | schedule_timeout_uninterruptible(1); |
427 | schedule_timeout(1); | ||
428 | max_count--; | 427 | max_count--; |
429 | } | 428 | } |
430 | 429 | ||