From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Arnav Kapoor <kapoorarnav43@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Gwendal Grignou" <gwendal@chromium.org>,
"Stephen Boyd" <swboyd@chromium.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/6] iio: proximity: sx9324: fix proximity threshold writes
Date: Mon, 23 Nov 2026 13:16:16 +0200 [thread overview]
Message-ID: <awQggK7cKRKH3jUg@ashevche-desk.local> (raw)
In-Reply-To: <awQfT6jSKo9pjxjU@ashevche-desk.local>
On Mon, Nov 23, 2026 at 01:11:11PM +0200, Andy Shevchenko wrote:
> On Sun, Nov 22, 2026 at 01:16:42PM +0530, Arnav Kapoor wrote:
...
> > {
> > - unsigned int reg, val = _val;
> > + unsigned int reg, val;
> > +
> > + if (_val < 0)
> > + return -EINVAL;
> >
> > reg = SX9324_REG_PROX_CTRL6 + chan->channel / 2;
> > + val = _val;
>
>
> Why not simply
>
> val = _val;
> if (val < 0)
> return -EINVAL;
Ah, see the comment I gave in the other patch.
> ...
> reg = SX9324_REG_PROX_CTRL6 + chan->channel / 2;
>
> Note, reg might still be not used, we have more validations and with your
> approach the reg assignment is in the middle, confusing...
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-11-23 11:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 7:46 [PATCH v2 0/6] iio: proximity: sx93xx: fix raw reads, thresholds, hysteresis and gain Arnav Kapoor
2026-11-22 7:46 ` [PATCH v2 1/6] iio: proximity: sx_common: fix raw reads while the trigger is in use Arnav Kapoor
2026-11-22 7:46 ` [PATCH v2 2/6] iio: proximity: sx9324: fix proximity threshold writes Arnav Kapoor
2026-11-23 11:11 ` Andy Shevchenko
2026-11-23 11:16 ` Andy Shevchenko [this message]
2026-11-23 13:17 ` Arnav Kapoor
2026-11-22 7:46 ` [PATCH v2 3/6] iio: proximity: sx9324: reject negative hysteresis values Arnav Kapoor
2026-11-23 11:15 ` Andy Shevchenko
2026-11-23 11:18 ` Andy Shevchenko
2026-11-23 13:17 ` Arnav Kapoor
2026-11-22 7:46 ` [PATCH v2 4/6] iio: proximity: sx9360: fix hardware gain encoding Arnav Kapoor
2026-11-22 7:46 ` [PATCH v2 5/6] iio: proximity: sx9360: fix proximity threshold writes Arnav Kapoor
2026-11-22 7:46 ` [PATCH v2 6/6] iio: proximity: sx9360: reject negative hysteresis values Arnav Kapoor
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=awQggK7cKRKH3jUg@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=gwendal@chromium.org \
--cc=jic23@kernel.org \
--cc=kapoorarnav43@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=swboyd@chromium.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 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®