From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Arnav Kapoor" <kapoorarnav43@gmail.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/4] iio: proximity: aw96103: fix diff sign, missing config, async config lifetime and event values
Date: Fri, 4 Dec 2026 23:45:34 +0000 [thread overview]
Message-ID: <20261204234534.2216a1d4@jic23-hlaptop> (raw)
In-Reply-To: <aw2LhoyHkIwbU3nO@ashevche-desk.local>
On Mon, 30 Nov 2026 16:43:18 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Mon, Nov 30, 2026 at 12:34:29AM +0000, Jonathan Cameron wrote:
> >
> > > - 4: kept the explicit range check rather than FIELD_FIT() (Jonathan):
> > > on 32-bit, FIELD_FIT() shifts the value in a 32-bit unsigned long, so
> > > high bits fall off and e.g. 16777216 or INT_MIN pass as fitting the
> > > OUTDEB field and are written as 0 (1020 such int values for
> > > GENMASK(9, 8), 16380 for GENMASK(13, 12)); on 64-bit it is exact.
> >
> > Interesting point. I'd never looked at it closely.
> >
> > I wonder if their is appetite to fix that?
> > Would simply shifting the the mask right instead of the value left when checking
> > the fit do the job? That might end up more expensive if the aim is simply to
> > avoid overwriting other fields as the compiler might figure out how to combine
> > the guts of FIELD_FIT with other necessary steps. Perhaps have a play around
> > and see if it manages that or not?
> >
> > What do others think?
>
> Sounds like a bug in FIELD_FIT() to me that calls to be fixed.
>
Great to see a proposed fix for FIELD_FIT() on the list.
I don't want to potentially block these fixes as a result
(or keep track of them just for this!) so I'll apply these
now. Perhaps Arnav can circle back and switch to the 'fixed'
FIELD_FIT() as a follow up cleanup next cycle.
Applied to the testing branch of iio.git and marked for stable.
The fixes-togreg tree is now more or less closed for this cycle
just due to timing and my likely availability over next few weeks.
Thanks,
Jonathan
prev parent reply other threads:[~2026-12-04 23:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 11:51 Arnav Kapoor
2026-11-28 11:51 ` [PATCH v2 1/4] iio: proximity: aw96103: report negative proximity diff values Arnav Kapoor
2026-11-28 11:51 ` [PATCH v2 2/4] iio: proximity: aw96103: use the default configuration without firmware Arnav Kapoor
2026-11-28 11:51 ` [PATCH v2 3/4] iio: proximity: aw96103: wait for the configuration load before freeing Arnav Kapoor
2026-11-28 11:51 ` [PATCH v2 4/4] iio: proximity: aw96103: reject out-of-range debounce and hysteresis values Arnav Kapoor
2026-11-30 0:34 ` [PATCH v2 0/4] iio: proximity: aw96103: fix diff sign, missing config, async config lifetime and event values Jonathan Cameron
2026-11-30 14:43 ` Andy Shevchenko
2026-12-04 23:45 ` Jonathan Cameron [this message]
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=20261204234534.2216a1d4@jic23-hlaptop \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=kapoorarnav43@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.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®