diff mbox

ASoC: omap-pcm: off-by-one in 'omap_pcm_limit_supported_formats'

Message ID 1472712757-21066-1-git-send-email-christophe.jaillet@wanadoo.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Christophe JAILLET Sept. 1, 2016, 6:52 a.m. UTC
When calling 'snd_pcm_format_physical_width', SNDRV_PCM_FORMAT_LAST is a
valid value, so don't skip it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Un-tested
---
 sound/soc/omap/omap-pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Ujfalusi Sept. 1, 2016, 6:59 a.m. UTC | #1
On 09/01/16 09:52, Christophe JAILLET wrote:
> When calling 'snd_pcm_format_physical_width', SNDRV_PCM_FORMAT_LAST is a
> valid value, so don't skip it.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Un-tested
> ---
>  sound/soc/omap/omap-pcm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
> index a84f677234f0..94e9ff791f3a 100644
> --- a/sound/soc/omap/omap-pcm.c
> +++ b/sound/soc/omap/omap-pcm.c
> @@ -58,7 +58,7 @@ static void omap_pcm_limit_supported_formats(void)
>  {
>  	int i;
>  
> -	for (i = 0; i < SNDRV_PCM_FORMAT_LAST; i++) {
> +	for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) {
>  		switch (snd_pcm_format_physical_width(i)) {
>  		case 8:
>  		case 16:
>
diff mbox

Patch

diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index a84f677234f0..94e9ff791f3a 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -58,7 +58,7 @@  static void omap_pcm_limit_supported_formats(void)
 {
 	int i;
 
-	for (i = 0; i < SNDRV_PCM_FORMAT_LAST; i++) {
+	for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) {
 		switch (snd_pcm_format_physical_width(i)) {
 		case 8:
 		case 16: