diff mbox

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

Message ID 1525621665-11022-3-git-send-email-festevam@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fabio Estevam May 6, 2018, 3:47 p.m. UTC
From: Fabio Estevam <fabio.estevam@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@nxp.com>
---
 sound/soc/omap/omap-pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Mark Brown May 9, 2018, 8:33 a.m. UTC | #1
On Sun, May 06, 2018 at 12:47:45PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> 'snd_pcm_format_t' type is better suited for iterating through the
> SNDRV_PCM_FORMAT members.

Peter (who you didn't CC on this or the DaVinci patch) is just in the
process of removing the omap-pcm driver so it'll just cause hassle to
apply this.
diff mbox

Patch

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: