Message ID | 87tukgzf2p.wl-kuninori.morimoto.gx@renesas.com |
---|---|
State | Accepted |
Commit | 2bc3e1f21b06802e70d9ccd5f8756099ffd04eb2 |
Headers | show |
Series | [1/5] ASoC: soc-pcm: cleanup cppcheck warning at soc_pcm_apply_msb() | expand |
On 7/26/21 9:05 PM, Kuninori Morimoto wrote: > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > > This patch cleanups below cppcheck warning. > > sound/soc/soc-pcm.c:446:29: style: The scope of the variable 'pcm_codec' can be reduced. [variableScope] > struct snd_soc_pcm_stream *pcm_codec, *pcm_cpu; > ^ > sound/soc/soc-pcm.c:446:41: style: The scope of the variable 'pcm_cpu' can be reduced. [variableScope] > struct snd_soc_pcm_stream *pcm_codec, *pcm_cpu; > ^ I personally ignore those warnings, there are hundreds of them and it'd be a relatively marginal improvement in code quality. my scripts use the following options to focus on more important issues first. --suppress=variableScope --suppress=shiftTooManyBitsSigned --suppress=arithOperationsOnVoidPointer --suppress=bitwiseOnBoolean
Hi Pierre-Louis Thank you for your feedback > > sound/soc/soc-pcm.c:446:29: style: The scope of the variable 'pcm_codec' can be reduced. [variableScope] > > struct snd_soc_pcm_stream *pcm_codec, *pcm_cpu; > > ^ > > sound/soc/soc-pcm.c:446:41: style: The scope of the variable 'pcm_cpu' can be reduced. [variableScope] > > struct snd_soc_pcm_stream *pcm_codec, *pcm_cpu; > > ^ > > I personally ignore those warnings, there are hundreds of them and it'd > be a relatively marginal improvement in code quality. > > my scripts use the following options to focus on more important issues > first. Yes, these are not important and boring patch :) But it will be indicated forever if no one fix it. I can squash all soc-xxx.c related patches into 1 patch, but it is not good for backporting (?) Thank you for your help !! Best regards --- Kuninori Morimoto
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index cd12ce14096d..69c1022885ed 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -449,13 +449,12 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream) struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_dai *cpu_dai; struct snd_soc_dai *codec_dai; - struct snd_soc_pcm_stream *pcm_codec, *pcm_cpu; int stream = substream->stream; int i; unsigned int bits = 0, cpu_bits = 0; for_each_rtd_codec_dais(rtd, i, codec_dai) { - pcm_codec = snd_soc_dai_get_pcm_stream(codec_dai, stream); + struct snd_soc_pcm_stream *pcm_codec = snd_soc_dai_get_pcm_stream(codec_dai, stream); if (pcm_codec->sig_bits == 0) { bits = 0; @@ -465,7 +464,7 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream) } for_each_rtd_cpu_dais(rtd, i, cpu_dai) { - pcm_cpu = snd_soc_dai_get_pcm_stream(cpu_dai, stream); + struct snd_soc_pcm_stream *pcm_cpu = snd_soc_dai_get_pcm_stream(cpu_dai, stream); if (pcm_cpu->sig_bits == 0) { cpu_bits = 0;