mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: cs35l56: fix reversed if statement in cs35l56_dspwait_asp1tx_put()
@ 2024-02-05 12:44 Dan Carpenter
  2024-02-05 14:01 ` Richard Fitzgerald
  2024-02-05 16:58 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-02-05 12:44 UTC (permalink / raw)
  To: Richard Fitzgerald
  Cc: James Schulman, David Rhodes, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, patches, linux-sound,
	linux-kernel, kernel-janitors

It looks like the "!" character was added accidentally.  The
regmap_update_bits_check() function is normally going to succeed.  This
means the rest of the function is unreachable and we don't handle the
situation where "changed" is true correctly.

Fixes: 07f7d6e7a124 ("ASoC: cs35l56: Fix for initializing ASP1 mixer registers")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
From static analysis and review, not tested.
---
 sound/soc/codecs/cs35l56.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c
index c23e29da4cfb..ebed5ab1245b 100644
--- a/sound/soc/codecs/cs35l56.c
+++ b/sound/soc/codecs/cs35l56.c
@@ -115,7 +115,7 @@ static int cs35l56_dspwait_asp1tx_put(struct snd_kcontrol *kcontrol,
 
 	ret = regmap_update_bits_check(cs35l56->base.regmap, addr,
 				       CS35L56_ASP_TXn_SRC_MASK, val, &changed);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	if (changed)
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: cs35l56: fix reversed if statement in cs35l56_dspwait_asp1tx_put()
  2024-02-05 12:44 [PATCH] ASoC: cs35l56: fix reversed if statement in cs35l56_dspwait_asp1tx_put() Dan Carpenter
@ 2024-02-05 14:01 ` Richard Fitzgerald
  2024-02-05 16:58 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2024-02-05 14:01 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	alsa-devel, patches, linux-sound, linux-kernel, kernel-janitors

On 05/02/2024 12:44, Dan Carpenter wrote:
> It looks like the "!" character was added accidentally.  The
> regmap_update_bits_check() function is normally going to succeed.  This
> means the rest of the function is unreachable and we don't handle the
> situation where "changed" is true correctly.
> 
> Fixes: 07f7d6e7a124 ("ASoC: cs35l56: Fix for initializing ASP1 mixer registers")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>>From static analysis and review, not tested.
> ---
>   sound/soc/codecs/cs35l56.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c
> index c23e29da4cfb..ebed5ab1245b 100644
> --- a/sound/soc/codecs/cs35l56.c
> +++ b/sound/soc/codecs/cs35l56.c
> @@ -115,7 +115,7 @@ static int cs35l56_dspwait_asp1tx_put(struct snd_kcontrol *kcontrol,
>   
>   	ret = regmap_update_bits_check(cs35l56->base.regmap, addr,
>   				       CS35L56_ASP_TXn_SRC_MASK, val, &changed);
> -	if (!ret)
> +	if (ret)
>   		return ret;
>   
>   	if (changed)

Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: cs35l56: fix reversed if statement in cs35l56_dspwait_asp1tx_put()
  2024-02-05 12:44 [PATCH] ASoC: cs35l56: fix reversed if statement in cs35l56_dspwait_asp1tx_put() Dan Carpenter
  2024-02-05 14:01 ` Richard Fitzgerald
@ 2024-02-05 16:58 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2024-02-05 16:58 UTC (permalink / raw)
  To: Richard Fitzgerald, Dan Carpenter
  Cc: James Schulman, David Rhodes, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, alsa-devel, patches, linux-sound, linux-kernel,
	kernel-janitors

On Mon, 05 Feb 2024 15:44:30 +0300, Dan Carpenter wrote:
> It looks like the "!" character was added accidentally.  The
> regmap_update_bits_check() function is normally going to succeed.  This
> means the rest of the function is unreachable and we don't handle the
> situation where "changed" is true correctly.
> 
> 

Applied to

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

Thanks!

[1/1] ASoC: cs35l56: fix reversed if statement in cs35l56_dspwait_asp1tx_put()
      commit: 4703b014f28bf7a2e56d1da238ee95ef6c5ce76b

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] 3+ messages in thread

end of thread, other threads:[~2024-02-05 16:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-05 12:44 [PATCH] ASoC: cs35l56: fix reversed if statement in cs35l56_dspwait_asp1tx_put() Dan Carpenter
2024-02-05 14:01 ` Richard Fitzgerald
2024-02-05 16:58 ` 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®