ASoC: soc-core: fix for_rtd_codec_dai_rollback() macro
diff mbox series

Message ID 20200219222130.29933-1-pierre-louis.bossart@linux.intel.com
State Accepted
Commit 63d68382f5fb5f71772357e31841c19c4a133182
Headers show
Series
  • ASoC: soc-core: fix for_rtd_codec_dai_rollback() macro
Related show

Commit Message

Pierre-Louis Bossart Feb. 19, 2020, 10:21 p.m. UTC
The use of parentheses to protect the argument is fine for (i)++ but
not for (--i).

Fixes: 83f94a2e293d61 ("ASoC: soc-core: add snd_soc_close_delayed_work()")
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 include/sound/soc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kuninori Morimoto Feb. 20, 2020, 12:06 a.m. UTC | #1
Hi Pierre-Louis

Thank you for your patch

> The use of parentheses to protect the argument is fine for (i)++ but
> not for (--i).
> 
> Fixes: 83f94a2e293d61 ("ASoC: soc-core: add snd_soc_close_delayed_work()")
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---

Yes, indeed.
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

>  include/sound/soc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/sound/soc.h b/include/sound/soc.h
> index f0e4f36f83bf..8a2266676b2d 100644
> --- a/include/sound/soc.h
> +++ b/include/sound/soc.h
> @@ -1157,7 +1157,7 @@ struct snd_soc_pcm_runtime {
>  	     ((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]); \
>  	     (i)++)
>  #define for_each_rtd_codec_dai_rollback(rtd, i, dai)		\
> -	for (; ((--i) >= 0) && ((dai) = rtd->codec_dais[i]);)
> +	for (; (--(i) >= 0) && ((dai) = rtd->codec_dais[i]);)
>  
>  void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);
>  
> -- 
> 2.20.1
>

Patch
diff mbox series

diff --git a/include/sound/soc.h b/include/sound/soc.h
index f0e4f36f83bf..8a2266676b2d 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1157,7 +1157,7 @@  struct snd_soc_pcm_runtime {
 	     ((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]); \
 	     (i)++)
 #define for_each_rtd_codec_dai_rollback(rtd, i, dai)		\
-	for (; ((--i) >= 0) && ((dai) = rtd->codec_dais[i]);)
+	for (; (--(i) >= 0) && ((dai) = rtd->codec_dais[i]);)
 
 void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);