* [PATCH] ASoC: codecs: aw88261: small cleanup in aw88261_set_tdm_slot()
@ 2026-10-01 6:51 Dan Carpenter
2026-10-02 11:26 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2026-10-01 6:51 UTC (permalink / raw)
To: Val Packett
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Luca Weiss, Charles Keepax, Kuninori Morimoto, linux-sound,
linux-kernel, kernel-janitors
This code triggers a Smatch false positive:
sound/soc/codecs/aw88261.c:858 aw88261_set_tdm_slot()
error: uninitialized symbol 'chan'.
This would only happen if both the tx and rx masks were zero which is
a nonsense scenario and reviewing the callers shows that it never
happens.
However, if the rx_mask is zero then we're comparing the mask from RX
against the chan from TX which is confusing:
if ((rx_mask & ~BIT(chan)) != 0) {
^^ rx ^^^^ tx chan
Of course, in that case the condition is going to be false because
the rx_mask is zero. So it's fine. But it would be more clear to move
the condition inside the if statement and it silences the static checker
warning as well.
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
From code review. Untested.
sound/soc/codecs/aw88261.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/aw88261.c b/sound/soc/codecs/aw88261.c
index b8d06534bc8f..8671069f4c18 100644
--- a/sound/soc/codecs/aw88261.c
+++ b/sound/soc/codecs/aw88261.c
@@ -853,13 +853,13 @@ static int aw88261_set_tdm_slot(struct snd_soc_dai *dai,
return -EINVAL;
aw88261->rxl_slotvld_mask = chan << AW88261_I2S_RXL_SLOTVLD_START_BIT;
- }
- if ((rx_mask & ~BIT(chan)) != 0) {
- if ((chan = __ffs(rx_mask & ~BIT(chan))) > 16)
- return -EINVAL;
+ if ((rx_mask & ~BIT(chan)) != 0) {
+ if ((chan = __ffs(rx_mask & ~BIT(chan))) > 16)
+ return -EINVAL;
- aw88261->rxr_slotvld_mask = chan << AW88261_I2S_RXR_SLOTVLD_START_BIT;
+ aw88261->rxr_slotvld_mask = chan << AW88261_I2S_RXR_SLOTVLD_START_BIT;
+ }
}
return 0;
--
2.53.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: codecs: aw88261: small cleanup in aw88261_set_tdm_slot()
2026-10-01 6:51 [PATCH] ASoC: codecs: aw88261: small cleanup in aw88261_set_tdm_slot() Dan Carpenter
@ 2026-10-02 11:26 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-10-02 11:26 UTC (permalink / raw)
To: Val Packett, Dan Carpenter
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Luca Weiss,
Charles Keepax, Kuninori Morimoto, linux-sound, linux-kernel,
kernel-janitors
On Thu, 01 Oct 2026 09:51:39 +0300, Dan Carpenter wrote:
> ASoC: codecs: aw88261: small cleanup in aw88261_set_tdm_slot()
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/1] ASoC: codecs: aw88261: small cleanup in aw88261_set_tdm_slot()
https://git.kernel.org/broonie/sound/c/015f14e42b22
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] 2+ messages in thread
end of thread, other threads:[~2026-10-02 12:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01 6:51 [PATCH] ASoC: codecs: aw88261: small cleanup in aw88261_set_tdm_slot() Dan Carpenter
2026-10-02 11:26 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®