summaryrefslogtreecommitdiff
path: root/sound/core/seq/seq_fifo.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2025-08-27 10:05:13 +0200
committerTakashi Iwai <tiwai@suse.de>2025-08-29 11:52:36 +0200
commit9314e34e37292f2d3d43dcc8a7f54366b4c0811d (patch)
tree89f411e0208ff1d6a23f68a520a01e4aca558111 /sound/core/seq/seq_fifo.h
parent04a86185b7853971786d1d4b375b5544edd8d44d (diff)
ALSA: seq: Clean up fifo locking with guard
Yet more cleanup, now for seq_fifo.c about its refcount calls; the manual refcount calls (either snd_use_lock_*() or snd_seq_fifo_lock()) are replaced with guard(snd_seq_fifo). Only code refactoring, and no behavior change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250827080520.7544-8-tiwai@suse.de
Diffstat (limited to 'sound/core/seq/seq_fifo.h')
-rw-r--r--sound/core/seq/seq_fifo.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/core/seq/seq_fifo.h b/sound/core/seq/seq_fifo.h
index b56a7b897c9c..4c9c49127746 100644
--- a/sound/core/seq/seq_fifo.h
+++ b/sound/core/seq/seq_fifo.h
@@ -37,6 +37,7 @@ int snd_seq_fifo_event_in(struct snd_seq_fifo *f, struct snd_seq_event *event);
/* lock fifo from release */
#define snd_seq_fifo_lock(fifo) snd_use_lock_use(&(fifo)->use_lock)
#define snd_seq_fifo_unlock(fifo) snd_use_lock_free(&(fifo)->use_lock)
+DEFINE_GUARD(snd_seq_fifo, struct snd_seq_fifo *, snd_seq_fifo_lock(_T), snd_seq_fifo_unlock(_T))
/* get a cell from fifo - fifo should be locked */
int snd_seq_fifo_cell_out(struct snd_seq_fifo *f, struct snd_seq_event_cell **cellp, int nonblock);