Re: [PATCH v2 1/4] ASoC: amd: acp: remove conditional return with no effect
"Mukunda,Vijendar" <[email protected]>
| Newsgroups | org.kernel.vger.linux-sound,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 7/25/26 21:33, Sang-Heon Jeon wrote: > [You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] > > Both branches of the check return the same value, so the check has > no effect. Remove it and return the value directly. > > This is the result of running the Coccinelle script from > scripts/coccinelle/misc/cond_return_no_effect.cocci. > > Signed-off-by: Sang-Heon Jeon <[email protected]> Reviewed-by: Vijendar Mukunda <[email protected]> > --- > sound/soc/amd/acp/acp-mach-common.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c > index ef784cca13f2..01a0aaa60246 100644 > --- a/sound/soc/amd/acp/acp-mach-common.c > +++ b/sound/soc/amd/acp/acp-mach-common.c > @@ -938,15 +938,10 @@ static int acp_max98388_hw_params(struct snd_pcm_substream *substream, > struct snd_soc_dai *codec_dai = > snd_soc_card_get_codec_dai(card, > MAX98388_CODEC_DAI); > - int ret; > > - ret = snd_soc_dai_set_fmt(codec_dai, > - SND_SOC_DAIFMT_CBC_CFC | SND_SOC_DAIFMT_I2S | > - SND_SOC_DAIFMT_NB_NF); > - if (ret < 0) > - return ret; > - > - return ret; > + return snd_soc_dai_set_fmt(codec_dai, > + SND_SOC_DAIFMT_CBC_CFC | SND_SOC_DAIFMT_I2S | > + SND_SOC_DAIFMT_NB_NF); > } > > static const struct snd_soc_ops acp_max98388_ops = { > -- > 2.43.0 >