Re: [PATCH 4/4] iio: buffer: fix timestamp alignment when quaternion in scan
From: Andy Shevchenko
Date: Mon Mar 02 2026 - 11:09:42 EST
On Mon, Mar 02, 2026 at 09:39:30AM -0600, David Lechner wrote:
> On 3/2/26 2:47 AM, Andy Shevchenko wrote:
> > On Sun, Mar 01, 2026 at 02:24:53PM -0600, David Lechner wrote:
...
> >> - ((int64_t *)data)[ts_offset] = timestamp;
> >
> >> + *(int64_t *)(data + ts_offset) = timestamp;
> >
> > What's the point in modifying this? The comment you added suffice for
> > the original line.
>
> ts_offset is now in bytes rather than number of int64_t elements.
> So ((int64_t *)data)[ts_offset] would now 8x past the end of the array.
So semantic of the variable changed w/o name changing... OK.
--
With Best Regards,
Andy Shevchenko