From: Mark Brown <broonie@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/2] ASoC: ops: fix signedness bug in snd_soc_put_volsw()
Date: Fri, 28 Jan 2022 13:48:44 +0000 [thread overview]
Message-ID: <YfP0PGbyFVDOevIH@sirena.org.uk> (raw)
In-Reply-To: <20220128133147.GL1978@kadam>
[-- Attachment #1: Type: text/plain, Size: 1155 bytes --]
On Fri, Jan 28, 2022 at 04:31:47PM +0300, Dan Carpenter wrote:
> On Fri, Jan 28, 2022 at 12:42:04PM +0000, Mark Brown wrote:
> > This means that the helpers won't support controls that use the top bit
> > of a 32 bit register.
> Fine, I can delete the checks for negative instead (I'm surprised you
> haven't already received a dozen bot emails about this).
No, we need the checks for negatives since userspace supplies a signed
value. The check needs to be done on the value in the input structure
before we pull it out for mangling. I probably got bot emails but
frankly these days almost all of them are some combination of barely
legible and misdirected and there's plenty of people who like to fix
these things if they're real.
> I haven't been able to figure out where mc->min/max are set. In
They're the big tables of static assignments via macros in the drivers.
> snd_soc_get_xr_sx() it checks whether "mc->min" is negative.
> if (min < 0 && val > max)
> val |= ~mask;
> Is that a bug? If mc->min is negative the math gets tricky.
No, it *is* valid if weird to have negative values for some controls.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2022-01-28 13:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-28 11:20 Dan Carpenter
2022-01-28 12:42 ` Mark Brown
2022-01-28 13:31 ` Dan Carpenter
2022-01-28 13:48 ` Mark Brown [this message]
2022-01-28 14:05 ` Dan Carpenter
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=YfP0PGbyFVDOevIH@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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
all inboxes | Powered by JetHome®