Re: [PATCH] iio: adc: ad7766: Update to use iio_push_to_buffers_with_ts()

From: Jonathan Cameron

Date: Mon May 11 2026 - 09:52:18 EST


On Mon, 11 May 2026 13:40:26 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:

> On Sun, May 10, 2026 at 05:14:04PM -0500, Ethan Tidmore wrote:
> > The old ABI function iio_push_to_buffers_with_timestamp() is no longer
> > preferred due to it being inherently unsafe.
> >
> > Update to the current standard iio_push_to_buffers_with_ts().
>
> Nice, but there is nothing about correctness of the change. This is quite
> sensitive area which is ABI. Any breakage is a big deal. Have you studied
> the case deeper? What are the contents of the buffers with the old one and
> new one versus channels enabled? Is timestamp located in the same offset
> in both cases?
>
Lazy hint on this - check the implementations. One's implemented using the
other making these questions straight forward.

More interesting to me would be a statement of why that size is correct one
to pass. That is the most common source of bugs around these changes rather
than data placement issues (good to understand though!) Note that we have
broken data placement by 'cleaning' up the functions themselves in the past
but not just switching from one to the other.

So patch is right but a brief statement that struct ad7766.data is an
embedded array and so we can just take it's size would be nice to have in
the patch description.

Thanks!

Jonathan