From: Arnav Kapoor <kapoorarnav43@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
andy@kernel.org, gwendal@chromium.org, swboyd@chromium.org,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/6] iio: proximity: sx9324: reject negative hysteresis values
Date: Mon, 23 Nov 2026 18:47:48 +0530 [thread overview]
Message-ID: <20261123131748.16791-2-kapoorarnav43@gmail.com> (raw)
In-Reply-To: <awQg6X1ay0zyyyaf@ashevche-desk.local>
On Mon, Nov 23, 2026 at 01:18:01PM +0200, Andy Shevchenko wrote:
> On Mon, Nov 23, 2026 at 01:15:42PM +0200, Andy Shevchenko wrote:
...
> > val = _val;
> > if (val > INT_MAX)
> > return -EINVAL;
>
> On the second thought, the original < 0 check might be cleaner... Dunno.
> Jonathan, what do you think?
I'd also keep the _val < 0 check. It tests the value as userspace
wrote it, before the conversion, so it needs no comment explaining why
INT_MAX is the limit. But I'm happy to switch to val > INT_MAX in all
four patches if Jonathan prefers that.
Thanks,
Arnav
next prev parent reply other threads:[~2026-11-23 13:17 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
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 [this message]
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=20261123131748.16791-2-kapoorarnav43@gmail.com \
--to=kapoorarnav43@gmail.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=gwendal@chromium.org \
--cc=jic23@kernel.org \
--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®