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

iio: potentiostat: lmp91000: 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.

Here structure is not used, because this buffer is also used
elsewhere in the driver.

Fixes: 67e17300dc1d ("iio: potentiostat: add LMP91000 support")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Link: https://lore.kernel.org/r/20210501171352.512953-8-jic23@kernel.org

+2 -2
+2 -2
drivers/iio/potentiostat/lmp91000.c
··· 71 71 72 72 struct completion completion; 73 73 u8 chan_select; 74 - 75 - u32 buffer[4]; /* 64-bit data + 64-bit timestamp */ 74 + /* 64-bit data + 64-bit naturally aligned timestamp */ 75 + u32 buffer[4] __aligned(8); 76 76 }; 77 77 78 78 static const struct iio_chan_spec lmp91000_channels[] = {