2023-09-28 09:05:40

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH] ASoC: cs42l43: Remove useless else

The assignment of the else and if branches is the same, so the else
here is redundant, so we remove it.

./sound/soc/codecs/cs42l43-sdw.c:35:1-3: WARNING: possible condition with no effect (if == else).

Reported-by: Abaci Robot <[email protected]>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6712
Signed-off-by: Jiapeng Chong <[email protected]>
---
sound/soc/codecs/cs42l43-sdw.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sound/soc/codecs/cs42l43-sdw.c b/sound/soc/codecs/cs42l43-sdw.c
index 55ac5fe8c3db..388f95853b69 100644
--- a/sound/soc/codecs/cs42l43-sdw.c
+++ b/sound/soc/codecs/cs42l43-sdw.c
@@ -31,11 +31,7 @@ int cs42l43_sdw_add_peripheral(struct snd_pcm_substream *substream,
return -EINVAL;

snd_sdw_params_to_config(substream, params, &sconfig, &pconfig);
-
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- pconfig.num = dai->id;
- else
- pconfig.num = dai->id;
+ pconfig.num = dai->id;

ret = sdw_stream_add_slave(sdw, &sconfig, &pconfig, 1, sdw_stream);
if (ret) {
--
2.20.1.7.g153144c


2023-09-28 14:58:50

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] ASoC: cs42l43: Remove useless else

On Thu, 28 Sep 2023 16:52:00 +0800, Jiapeng Chong wrote:
> The assignment of the else and if branches is the same, so the else
> here is redundant, so we remove it.
>
> ./sound/soc/codecs/cs42l43-sdw.c:35:1-3: WARNING: possible condition with no effect (if == else).
>
>

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: cs42l43: Remove useless else
commit: 67fcdbfd9e133be69c9541a806f6ccfe594fa9a9

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