Re: [PATCH] iio: accel: adxl380: fix FIFO watermark bit 8 always written as 0
From: Andy Shevchenko
Date: Mon Mar 02 2026 - 02:56:53 EST
On Sat, Feb 28, 2026 at 10:50:00AM -0600, David Lechner wrote:
> On 2/27/26 6:43 AM, Antoniu Miclaus wrote:
...
> > + !!(fifo_samples & BIT(8))));
>
> Technically, this works, but in terms of understanding the code I think
> fifo_samples >= BIT(8) would make more sense.
>
> fifo_samples is a count, not bit flags.
I even would prefer to see in such a case
fifo_samples > (BIT(8) - 1)
that it will define the maximum that fits the HW, or plain number
fifo_samples > 127
--
With Best Regards,
Andy Shevchenko