[PATCH 1/2] ASOC: rochchip: Simplify the condition logic in rockchip_sai_xfer_stop
Pei Xiao
xiaopei01 at kylinos.cn
Tue Jun 3 20:13:29 PDT 2025
cocci warning:
./sound/soc/rockchip/rockchip_sai.c:387:8-10:
WARNING: possible condition with no effect (if == else)
Simplify the condition logic in rockchip_sai_xfer_stop() by removing the
redundant SNDRV_PCM_STREAM_PLAYBACK branch. The modified logic now:
1. For stream < 0: handles both playback and capture
2. For all other cases (both PLAYBACK and CAPTURE):
sets playback = true and capture = false
Signed-off-by: Pei Xiao <xiaopei01 at kylinos.cn>
---
sound/soc/rockchip/rockchip_sai.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/sound/soc/rockchip/rockchip_sai.c b/sound/soc/rockchip/rockchip_sai.c
index 602f1ddfad00..79b04770da1c 100644
--- a/sound/soc/rockchip/rockchip_sai.c
+++ b/sound/soc/rockchip/rockchip_sai.c
@@ -384,9 +384,6 @@ static void rockchip_sai_xfer_stop(struct rk_sai_dev *sai, int stream)
if (stream < 0) {
playback = true;
capture = true;
- } else if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
- playback = true;
- capture = false;
} else {
playback = true;
capture = false;
--
2.25.1
More information about the Linux-rockchip
mailing list