[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YfP0PGbyFVDOevIH@sirena.org.uk>
Date: Fri, 28 Jan 2022 13:48:44 +0000
From: Mark Brown <broonie@...nel.org>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 1/2] ASoC: ops: fix signedness bug in snd_soc_put_volsw()
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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists