* [PATCH v2 1/4] ASoC: amd: acp: remove conditional return with no effect
2026-07-25 16:03 [PATCH v2 0/4] ASoC: remove conditional returns with no effect Sang-Heon Jeon
@ 2026-07-25 16:03 ` Sang-Heon Jeon
2026-07-27 4:44 ` Mukunda,Vijendar
2026-07-25 16:03 ` [PATCH v2 2/4] ASoC: Intel: atom: " Sang-Heon Jeon
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Sang-Heon Jeon @ 2026-07-25 16:03 UTC (permalink / raw)
To: Vijendar Mukunda, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai
Cc: linux-kernel, linux-sound, Venkata Prasad Potturu
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>
---
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
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH v2 1/4] ASoC: amd: acp: remove conditional return with no effect
2026-07-25 16:03 ` [PATCH v2 1/4] ASoC: amd: acp: remove conditional return " Sang-Heon Jeon
@ 2026-07-27 4:44 ` Mukunda,Vijendar
0 siblings, 0 replies; 8+ messages in thread
From: Mukunda,Vijendar @ 2026-07-27 4:44 UTC (permalink / raw)
To: Sang-Heon Jeon, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai
Cc: linux-kernel, linux-sound, Venkata Prasad Potturu
On 7/25/26 21:33, Sang-Heon Jeon wrote:
> [You don't often get email from ekffu200098@gmail.com. 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 <ekffu200098@gmail.com>
Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
> ---
> 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
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/4] ASoC: Intel: atom: remove conditional return with no effect
2026-07-25 16:03 [PATCH v2 0/4] ASoC: remove conditional returns with no effect Sang-Heon Jeon
2026-07-25 16:03 ` [PATCH v2 1/4] ASoC: amd: acp: remove conditional return " Sang-Heon Jeon
@ 2026-07-25 16:03 ` Sang-Heon Jeon
2026-07-27 9:30 ` Cezary Rojewski
2026-07-25 16:03 ` [PATCH v2 3/4] ASoC: samsung: smdk_spdif: " Sang-Heon Jeon
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Sang-Heon Jeon @ 2026-07-25 16:03 UTC (permalink / raw)
To: Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
Kai Vehmanen, Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: linux-kernel, linux-sound, Pierre-Louis Bossart
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>
---
sound/soc/intel/atom/sst-mfld-platform-pcm.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
index 9ee4d9926e06..a4c8cbfba096 100644
--- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
+++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
@@ -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)
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH v2 2/4] ASoC: Intel: atom: remove conditional return with no effect
2026-07-25 16:03 ` [PATCH v2 2/4] ASoC: Intel: atom: " Sang-Heon Jeon
@ 2026-07-27 9:30 ` Cezary Rojewski
0 siblings, 0 replies; 8+ messages in thread
From: Cezary Rojewski @ 2026-07-27 9:30 UTC (permalink / raw)
To: Sang-Heon Jeon
Cc: linux-kernel, linux-sound, Pierre-Louis Bossart, Liam Girdwood,
Peter Ujfalusi, Bard Liao, Kai Vehmanen, Mark Brown,
Jaroslav Kysela, Takashi Iwai
On 7/25/2026 6:03 PM, Sang-Heon Jeon wrote:
> 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>
> ---
> sound/soc/intel/atom/sst-mfld-platform-pcm.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
> index 9ee4d9926e06..a4c8cbfba096 100644
> --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
> +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
> @@ -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)
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/4] ASoC: samsung: smdk_spdif: remove conditional return with no effect
2026-07-25 16:03 [PATCH v2 0/4] ASoC: remove conditional returns with no effect Sang-Heon Jeon
2026-07-25 16:03 ` [PATCH v2 1/4] ASoC: amd: acp: remove conditional return " Sang-Heon Jeon
2026-07-25 16:03 ` [PATCH v2 2/4] ASoC: Intel: atom: " Sang-Heon Jeon
@ 2026-07-25 16:03 ` Sang-Heon Jeon
2026-07-25 16:03 ` [PATCH v2 4/4] ASoC: SOF: Intel: " Sang-Heon Jeon
2026-07-27 13:09 ` [PATCH v2 0/4] ASoC: remove conditional returns " Mark Brown
4 siblings, 0 replies; 8+ messages in thread
From: Sang-Heon Jeon @ 2026-07-25 16:03 UTC (permalink / raw)
To: Sylwester Nawrocki, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai
Cc: linux-kernel, linux-sound
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>
---
sound/soc/samsung/smdk_spdif.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/samsung/smdk_spdif.c b/sound/soc/samsung/smdk_spdif.c
index 2474eb619882..515e4dfc1432 100644
--- a/sound/soc/samsung/smdk_spdif.c
+++ b/sound/soc/samsung/smdk_spdif.c
@@ -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 = {
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v2 4/4] ASoC: SOF: Intel: remove conditional return with no effect
2026-07-25 16:03 [PATCH v2 0/4] ASoC: remove conditional returns with no effect Sang-Heon Jeon
` (2 preceding siblings ...)
2026-07-25 16:03 ` [PATCH v2 3/4] ASoC: samsung: smdk_spdif: " Sang-Heon Jeon
@ 2026-07-25 16:03 ` Sang-Heon Jeon
2026-07-27 13:09 ` [PATCH v2 0/4] ASoC: remove conditional returns " Mark Brown
4 siblings, 0 replies; 8+ messages in thread
From: Sang-Heon Jeon @ 2026-07-25 16:03 UTC (permalink / raw)
To: Liam Girdwood, Peter Ujfalusi, Bard Liao, Daniel Baluta,
Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: Kai Vehmanen, linux-kernel, linux-sound, Pierre-Louis Bossart,
sound-open-firmware, Vijendar Mukunda
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>
---
sound/soc/sof/intel/hda-dsp.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c
index e9f092f082a1..b9b2bdff4ccb 100644
--- a/sound/soc/sof/intel/hda-dsp.c
+++ b/sound/soc/sof/intel/hda-dsp.c
@@ -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)
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH v2 0/4] ASoC: remove conditional returns with no effect
2026-07-25 16:03 [PATCH v2 0/4] ASoC: remove conditional returns with no effect Sang-Heon Jeon
` (3 preceding siblings ...)
2026-07-25 16:03 ` [PATCH v2 4/4] ASoC: SOF: Intel: " Sang-Heon Jeon
@ 2026-07-27 13:09 ` Mark Brown
4 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2026-07-27 13:09 UTC (permalink / raw)
To: Bard Liao, Cezary Rojewski, Daniel Baluta, Jaroslav Kysela,
Kai Vehmanen, Liam Girdwood, Liam Girdwood, Peter Ujfalusi,
Sylwester Nawrocki, Takashi Iwai, Vijendar Mukunda,
Sang-Heon Jeon
Cc: linux-kernel, linux-sound, Pierre-Louis Bossart,
sound-open-firmware, Venkata Prasad Potturu
On Sun, 26 Jul 2026 01:03:39 +0900, Sang-Heon Jeon wrote:
> ASoC: remove conditional returns with no effect
>
> Hello,
>
> This series removes conditional returns where both branches return
> the same value, so the check has no effect. As suggested by Vijendar,
> the ASoC patch of the treewide v1 series [1] is split per vendor and
> posted separately.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3
Thanks!
[1/4] ASoC: amd: acp: remove conditional return with no effect
https://git.kernel.org/broonie/asoc/c/3799a56da8f3
[2/4] ASoC: Intel: atom: remove conditional return with no effect
https://git.kernel.org/broonie/asoc/c/52c095772962
[3/4] ASoC: samsung: smdk_spdif: remove conditional return with no effect
https://git.kernel.org/broonie/asoc/c/cdb8b41357bb
[4/4] ASoC: SOF: Intel: remove conditional return with no effect
https://git.kernel.org/broonie/asoc/c/619446b87c0e
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 8+ messages in thread