Re: [PATCH v3 3/3] iio: adc: add driver for the MAX34417 Four-Channel High Dynamic Range Power Accumulator
From: Andy Shevchenko
Date: Tue Oct 20 2026 - 05:36:15 EST
On Tue, Oct 20, 2026 at 11:18:31AM +0200, Neil Armstrong wrote:
> On 10/20/26 11:13, David Laight wrote:
> > On Tue, 13 Oct 2026 16:07:13 +0200
> > Neil Armstrong <neil.armstrong@xxxxxxxxxx> wrote:
...
> > I was thinking:
> > struct { u64 pad:8; val:56 } buf;
> > then using bswap64(buf.val) >> 8 on LE.
> > But why not just:
> > u64 buf;
> > and be64toh(buf) & (BITULL(56) - 1)
>
> Right, I mean all this could work but I would like to keep using something
> simpler and get_unaligned_be56 matches all this.
> I don't think the need for performance is enough to use complex ways to get
> the value.
Also we need to be consistent with the existing implementations. If any of
those tricks will be needed, we better to apply to other cases (like e24/e48,
et cetera).
--
With Best Regards,
Andy Shevchenko