Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: adc: ti-ads8688: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()

Add __aligned(8) to ensure the buffer passed to
iio_push_to_buffers_with_timestamp() is suitable for the naturally
aligned timestamp that will be inserted.

Fixes: f214ff521fb1 ("iio: ti-ads8688: Update buffer allocation for timestamps")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210613152301.571002-5-jic23@kernel.org

+2 -1
+2 -1
drivers/iio/adc/ti-ads8688.c
··· 383 383 { 384 384 struct iio_poll_func *pf = p; 385 385 struct iio_dev *indio_dev = pf->indio_dev; 386 - u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)]; 386 + /* Ensure naturally aligned timestamp */ 387 + u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)] __aligned(8); 387 388 int i, j = 0; 388 389 389 390 for (i = 0; i < indio_dev->masklength; i++) {