Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: shumingf@realtek.com
Cc: broonie@kernel.org, lgirdwood@gmail.com,
	linux-sound@vger.kernel.org, lars@metafoo.de, flove@realtek.com,
	oder_chiou@realtek.com, jack.yu@realtek.com,
	derek.fang@realtek.com
Subject: Re: [PATCH] ASoC: SDCA: fix the register to ctl value conversion for Q7.8 format
Date: Fri, 27 Mar 2026 09:43:13 +0000	[thread overview]
Message-ID: <acZRMR/TBkAyKjWx@opensource.cirrus.com> (raw)
In-Reply-To: <20260327082331.2277498-1-shumingf@realtek.com>

On Fri, Mar 27, 2026 at 04:23:31PM +0800, shumingf@realtek.com wrote:
> From: Shuming Fan <shumingf@realtek.com>
> 
> The division calculation should be implemented using signed integer format.
> This patch changes mc->shift from an unsigned type to a signed integer during the calculation.
> 
> Fixes: 501efdcb3b3a ("ASoC: SDCA: Pull the Q7.8 volume helpers out of soc-ops")
> Signed-off-by: Shuming Fan <shumingf@realtek.com>
> ---
>  sound/soc/sdca/sdca_asoc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sdca/sdca_asoc.c b/sound/soc/sdca/sdca_asoc.c
> index 733c9808891a..7709a4ce26e0 100644
> --- a/sound/soc/sdca/sdca_asoc.c
> +++ b/sound/soc/sdca/sdca_asoc.c
> @@ -850,7 +850,7 @@ static int q78_read(struct snd_soc_component *component,
>  
>  	reg_val = snd_soc_component_read(component, reg);
>  
> -	val = (sign_extend32(reg_val, mc->sign_bit) / mc->shift) - mc->min;
> +	val = (sign_extend32(reg_val, mc->sign_bit) / (int)mc->shift) - mc->min;

oops... yeah thanks for catching that.

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

  reply	other threads:[~2026-03-27  9:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27  8:23 [PATCH] ASoC: SDCA: fix the register to ctl value conversion for Q7.8 format shumingf
2026-03-27  9:43 ` Charles Keepax [this message]
2026-03-27 19:12 ` 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=acZRMR/TBkAyKjWx@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=derek.fang@realtek.com \
    --cc=flove@realtek.com \
    --cc=jack.yu@realtek.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=shumingf@realtek.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox