hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/sound/core/seq/seq_fifo.c
....@@ -1,22 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * ALSA sequencer FIFO
34 * Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
4
- *
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
- *
205 */
216
227 #include <sound/core.h>
....@@ -98,18 +83,17 @@
9883 void snd_seq_fifo_clear(struct snd_seq_fifo *f)
9984 {
10085 struct snd_seq_event_cell *cell;
101
- unsigned long flags;
10286
10387 /* clear overflow flag */
10488 atomic_set(&f->overflow, 0);
10589
10690 snd_use_lock_sync(&f->use_lock);
107
- spin_lock_irqsave(&f->lock, flags);
91
+ spin_lock_irq(&f->lock);
10892 /* drain the fifo */
10993 while ((cell = fifo_cell_out(f)) != NULL) {
11094 snd_seq_cell_free(cell);
11195 }
112
- spin_unlock_irqrestore(&f->lock, flags);
96
+ spin_unlock_irq(&f->lock);
11397 }
11498
11599
....@@ -195,9 +179,9 @@
195179 }
196180 set_current_state(TASK_INTERRUPTIBLE);
197181 add_wait_queue(&f->input_sleep, &wait);
198
- spin_unlock_irq(&f->lock);
182
+ spin_unlock_irqrestore(&f->lock, flags);
199183 schedule();
200
- spin_lock_irq(&f->lock);
184
+ spin_lock_irqsave(&f->lock, flags);
201185 remove_wait_queue(&f->input_sleep, &wait);
202186 if (signal_pending(current)) {
203187 spin_unlock_irqrestore(&f->lock, flags);
....@@ -239,7 +223,6 @@
239223 /* change the size of pool; all old events are removed */
240224 int snd_seq_fifo_resize(struct snd_seq_fifo *f, int poolsize)
241225 {
242
- unsigned long flags;
243226 struct snd_seq_pool *newpool, *oldpool;
244227 struct snd_seq_event_cell *cell, *next, *oldhead;
245228
....@@ -255,7 +238,7 @@
255238 return -ENOMEM;
256239 }
257240
258
- spin_lock_irqsave(&f->lock, flags);
241
+ spin_lock_irq(&f->lock);
259242 /* remember old pool */
260243 oldpool = f->pool;
261244 oldhead = f->head;
....@@ -265,7 +248,7 @@
265248 f->tail = NULL;
266249 f->cells = 0;
267250 /* NOTE: overflow flag is not cleared */
268
- spin_unlock_irqrestore(&f->lock, flags);
251
+ spin_unlock_irq(&f->lock);
269252
270253 /* close the old pool and wait until all users are gone */
271254 snd_seq_pool_mark_closing(oldpool);