[alsa-devel] [PATCH 7/8] ALSA: pcm_dmaengine: Use pcm_for_each_format() macro for PCM format iteration
Takashi Iwai
tiwai at suse.de
Thu Feb 6 17:39:44 CET 2020
The new macro can fix the sparse warnings gracefully:
sound/core/pcm_dmaengine.c:429:50: warning: restricted snd_pcm_format_t degrades to integer
sound/core/pcm_dmaengine.c:429:55: warning: restricted snd_pcm_format_t degrades to integer
sound/core/pcm_dmaengine.c:429:79: warning: restricted snd_pcm_format_t degrades to integer
No functional changes, just sparse warning fixes.
Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
sound/core/pcm_dmaengine.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c
index 5749a8a49784..b37c70864b57 100644
--- a/sound/core/pcm_dmaengine.c
+++ b/sound/core/pcm_dmaengine.c
@@ -426,7 +426,7 @@ int snd_dmaengine_pcm_refine_runtime_hwparams(
* default assumption is that it supports 1, 2 and 4 bytes
* widths.
*/
- for (i = SNDRV_PCM_FORMAT_FIRST; i <= SNDRV_PCM_FORMAT_LAST; i++) {
+ pcm_for_each_format(i) {
int bits = snd_pcm_format_physical_width(i);
/*
--
2.16.4
More information about the Alsa-devel
mailing list