Re: [PATCH v2 3/6] iio: proximity: sx9324: reject negative hysteresis values

From: Arnav Kapoor

Date: Mon Nov 23 2026 - 08:18:06 EST


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