Re: [PATCH] iio: adc: ti-ads7950: use iio_push_to_buffers_with_ts_unaligned()
From: Andy Shevchenko
Date: Sun Mar 08 2026 - 16:43:33 EST
On Sat, Mar 07, 2026 at 03:15:55PM -0600, David Lechner wrote:
> Use iio_push_to_buffers_with_ts_unaligned() to avoid unaligned access
> when writing the timestamp in the rx_buf.
>
> The previous implementation would have been fine on architectures that
> support 4-byte alignment of 64-bit integers but could cause issues on
> architectures that require 8-byte alignment.
...
> - iio_push_to_buffers_with_timestamp(indio_dev, &st->rx_buf[2],
> - iio_get_time_ns(indio_dev));
> + iio_push_to_buffers_with_ts_unaligned(indio_dev, &st->rx_buf[2],
> + sizeof(u16) * TI_ADS7950_MAX_CHAN,
sizeof(*st->rx_buf) OR sizeof(st->rx_buf[2]) ?
> + iio_get_time_ns(indio_dev));
--
With Best Regards,
Andy Shevchenko