diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-03-28 16:21:01 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-04-09 17:22:46 +0200 |
commit | f823b8a75527dca0b93cf577bbabbe47fd79b2a8 (patch) | |
tree | c010b0f5f1a8283bf37724bb74f40dd1eef8408b /sound/core/seq/seq_memory.c | |
parent | 4b24b960b10b6a4e30beba3ce097fa867b4a085f (diff) | |
download | linux-f823b8a75527dca0b93cf577bbabbe47fd79b2a8.tar.gz linux-f823b8a75527dca0b93cf577bbabbe47fd79b2a8.tar.bz2 linux-f823b8a75527dca0b93cf577bbabbe47fd79b2a8.zip |
ALSA: seq: Remove superfluous irqsave flags
spin_lock_irqsave() is used unnecessarily in various places in
sequencer core code although it's pretty obvious that the context is
sleepable. Remove irqsave and use the plain spin_lock_irq() in such
places for simplicity.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/seq/seq_memory.c')
-rw-r--r-- | sound/core/seq/seq_memory.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c index ae0b8971f6ce..19b718e871c5 100644 --- a/sound/core/seq/seq_memory.c +++ b/sound/core/seq/seq_memory.c @@ -384,7 +384,6 @@ int snd_seq_pool_init(struct snd_seq_pool *pool) { int cell; struct snd_seq_event_cell *cellptr; - unsigned long flags; if (snd_BUG_ON(!pool)) return -EINVAL; @@ -395,9 +394,9 @@ int snd_seq_pool_init(struct snd_seq_pool *pool) return -ENOMEM; /* add new cells to the free cell list */ - spin_lock_irqsave(&pool->lock, flags); + spin_lock_irq(&pool->lock); if (pool->ptr) { - spin_unlock_irqrestore(&pool->lock, flags); + spin_unlock_irq(&pool->lock); kvfree(cellptr); return 0; } @@ -416,7 +415,7 @@ int snd_seq_pool_init(struct snd_seq_pool *pool) /* init statistics */ pool->max_used = 0; pool->total_elements = pool->size; - spin_unlock_irqrestore(&pool->lock, flags); + spin_unlock_irq(&pool->lock); return 0; } @@ -435,7 +434,6 @@ void snd_seq_pool_mark_closing(struct snd_seq_pool *pool) /* remove events */ int snd_seq_pool_done(struct snd_seq_pool *pool) { - unsigned long flags; struct snd_seq_event_cell *ptr; if (snd_BUG_ON(!pool)) @@ -449,18 +447,18 @@ int snd_seq_pool_done(struct snd_seq_pool *pool) schedule_timeout_uninterruptible(1); /* release all resources */ - spin_lock_irqsave(&pool->lock, flags); + spin_lock_irq(&pool->lock); ptr = pool->ptr; pool->ptr = NULL; pool->free = NULL; pool->total_elements = 0; - spin_unlock_irqrestore(&pool->lock, flags); + spin_unlock_irq(&pool->lock); kvfree(ptr); - spin_lock_irqsave(&pool->lock, flags); + spin_lock_irq(&pool->lock); pool->closing = 0; - spin_unlock_irqrestore(&pool->lock, flags); + spin_unlock_irq(&pool->lock); return 0; } |