Re: [PATCH v9 08/11] iio: accel: adxl345: add inactivity feature
From: Andy Shevchenko
Date: Sat Jun 21 2025 - 15:25:28 EST
On Sat, Jun 21, 2025 at 9:54 PM Lothar Rubusch <l.rubusch@xxxxxxxxx> wrote:
> On Thu, Jun 12, 2025 at 2:15 PM Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxx> wrote:
> > On Tue, Jun 10, 2025 at 09:59:30PM +0000, Lothar Rubusch wrote:
Please, remove the pieces of email you agree with, or comment on why
you disagree. Leaving tons of the pieces without comments is confusing
at bare minimum.
...
> > > + val = (adxl345_odr_tbl[odr][0] > max_boundary)
> > > + ? min_boundary : max_boundary - adxl345_odr_tbl[odr][0];
> >
> > clamp() ?
>
> Isn't clamp() dealing with signed ints?
clamp() is a macro.
> Also, I'll take the diff from
> max_boundary here.
How does it affect usage of the clamp()?
> So, I'll try staying with the current line and hope
> it's fine.
I suggest you spend some time thinking about this expression on how to
make it easier to read and understand. In my opinion clamp() helps a
lot in this case.
--
With Best Regards,
Andy Shevchenko