From: Kuninori Morimoto Date: Mon, 17 Feb 2020 08:28:19 +0000 (+0900) Subject: ALSA: pcm.h: add for_each_pcm_streams() X-Git-Tag: v5.15~2585^2~226^2~151 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3193abd26b515ccac65e1c323533cb7f53d06176;p=platform%2Fkernel%2Flinux-starfive.git ALSA: pcm.h: add for_each_pcm_streams() ALSA code has SNDRV_PCM_STREAM_PLAYBACK/CAPTURE everywhere. Having for_each_xxxx macro is useful. This patch adds for_each_pcm_streams() for it. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Acked-by: Takashi Iwai Link: https://lore.kernel.org/r/874kvpbotq.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/include/sound/pcm.h b/include/sound/pcm.h index f657ff0..2628246 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -644,6 +644,11 @@ void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream, #define snd_pcm_group_for_each_entry(s, substream) \ list_for_each_entry(s, &substream->group->substreams, link_list) +#define for_each_pcm_streams(stream) \ + for (stream = SNDRV_PCM_STREAM_PLAYBACK; \ + stream <= SNDRV_PCM_STREAM_LAST; \ + stream++) + /** * snd_pcm_running - Check whether the substream is in a running state * @substream: substream to check