ASoC: remove conditional return with no effect

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 <ekffu200098@gmail.com>
Link: https://patch.msgid.link/20260723184538.3888637-15-ekffu200098@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Sang-Heon Jeon 2026-07-24 03:45:16 +09:00 committed by Mark Brown
parent 78a9d14264
commit ca9b51f41c
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
4 changed files with 7 additions and 25 deletions

View File

@ -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 = {

View File

@ -236,12 +236,7 @@ static int sst_platform_alloc_stream(struct snd_pcm_substream *substream,
stream->stream_info.str_id = str_params.stream_id;
ret_val = stream->ops->open(sst->dev, &str_params);
if (ret_val <= 0)
return ret_val;
return ret_val;
return stream->ops->open(sst->dev, &str_params);
}
static void sst_period_elapsed(void *arg)

View File

@ -130,12 +130,8 @@ static int smdk_hw_params(struct snd_pcm_substream *substream,
return ret;
/* Set S/PDIF uses internal source clock */
ret = snd_soc_dai_set_sysclk(cpu_dai, SND_SOC_SPDIF_INT_MCLK,
rclk_rate, SND_SOC_CLOCK_IN);
if (ret < 0)
return ret;
return ret;
return snd_soc_dai_set_sysclk(cpu_dai, SND_SOC_SPDIF_INT_MCLK,
rclk_rate, SND_SOC_CLOCK_IN);
}
static const struct snd_soc_ops smdk_spdif_ops = {

View File

@ -1114,11 +1114,7 @@ static int hda_dsp_s5_quirk(struct snd_sof_dev *sdev)
usleep_range(500, 1000);
/* Restore state for shutdown, back to reset */
ret = hda_dsp_ctrl_link_reset(sdev, true);
if (ret < 0)
return ret;
return ret;
return hda_dsp_ctrl_link_reset(sdev, true);
}
int hda_dsp_shutdown_dma_flush(struct snd_sof_dev *sdev)