All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org, stable@vger.kernel.org
Subject: Re: [PATCH v1 2/4] ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_sx()
Date: Mon, 18 Apr 2022 16:33:21 -0500	[thread overview]
Message-ID: <c77d892f-4ff3-f7ad-482f-c9673a3cd86f@linux.intel.com> (raw)
In-Reply-To: <20220201155629.120510-3-broonie@kernel.org>



On 2/1/22 09:56, Mark Brown wrote:
> When writing out a stereo control we discard the change notification from
> the first channel, meaning that events are only generated based on changes
> to the second channel. Ensure that we report a change if either channel
> has changed.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Cc: stable@vger.kernel.org
> ---
>  sound/soc/soc-ops.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
> index 73c9d53de25b..f0d1aeb38346 100644
> --- a/sound/soc/soc-ops.c
> +++ b/sound/soc/soc-ops.c
> @@ -413,6 +413,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
>  	int min = mc->min;
>  	unsigned int mask = (1U << (fls(min + max) - 1)) - 1;
>  	int err = 0;
> +	int ret;
>  	unsigned int val, val_mask;
>  
>  	val_mask = mask << shift;
> @@ -422,6 +423,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
>  	err = snd_soc_component_update_bits(component, reg, val_mask, val);
>  	if (err < 0)
>  		return err;
> +	ret = err;
>  
>  	if (snd_soc_volsw_is_stereo(mc)) {
>  		unsigned int val2;
> @@ -432,6 +434,11 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
>  
>  		err = snd_soc_component_update_bits(component, reg2, val_mask,
>  			val2);
> +
> +		/* Don't discard any error code or drop change flag */
> +		if (ret == 0 || err < 0) {
> +			ret = err;
> +		}
>  	}
>  	return err;

cppcheck flags a warning on this patch, I believe we should use "return ret;" here, as done in the other patches of this series?

https://github.com/thesofproject/linux/pull/3597/commits/85b667d190953231ef314ac429019a011596f6d7


  reply	other threads:[~2022-04-18 21:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 15:56 [PATCH v1 0/4] ASoC: ops: Fix stereo change notifications Mark Brown
2022-02-01 15:56 ` [PATCH v1 1/4] ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw() Mark Brown
2022-02-01 15:56 ` [PATCH v1 2/4] ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_sx() Mark Brown
2022-04-18 21:33   ` Pierre-Louis Bossart [this message]
2022-04-19 10:57     ` Mark Brown
2022-04-19 10:57       ` Mark Brown
2022-02-01 15:56 ` [PATCH v1 3/4] ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_range() Mark Brown
2022-02-01 15:56 ` [PATCH v1 4/4] ASoC: ops: Fix stereo change notifications in snd_soc_put_xr_sx() Mark Brown
2022-02-03 12:52 ` [PATCH v1 0/4] ASoC: ops: Fix stereo change notifications Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c77d892f-4ff3-f7ad-482f-c9673a3cd86f@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.