[alsa-devel] [PATCH 3/3] ASoC: omap-pcm: Use 'snd_pcm_format_t' type

Fabio Estevam festevam at gmail.com
Sun May 6 17:47:45 CEST 2018


From: Fabio Estevam <fabio.estevam at nxp.com>

'snd_pcm_format_t' type is better suited for iterating through the
SNDRV_PCM_FORMAT members.

Also, use SNDRV_PCM_FORMAT_FIRST for the first element.

Signed-off-by: Fabio Estevam <fabio.estevam at nxp.com>
---
 sound/soc/omap/omap-pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 778cc8f..d1b07e4 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -56,9 +56,9 @@ static struct snd_pcm_hardware omap_pcm_hardware = {
 /* sDMA supports only 1, 2, and 4 byte transfer elements. */
 static void omap_pcm_limit_supported_formats(void)
 {
-	int i;
+	snd_pcm_format_t i;
 
-	for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) {
+	for (i = SNDRV_PCM_FORMAT_FIRST; i <= SNDRV_PCM_FORMAT_LAST; i++) {
 		switch (snd_pcm_format_physical_width(i)) {
 		case 8:
 		case 16:
-- 
2.7.4



More information about the Alsa-devel mailing list