Skip to content

Commit

Permalink
iio: adc: ti-ads8688: Fix alignment of buffer in iio_push_to_buffers_…
Browse files Browse the repository at this point in the history
…with_timestamp()

[ Upstream commit 61fa5df ]

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: f214ff5 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jic23 authored and gregkh committed Jul 14, 2021
1 parent 15634d6 commit c923e9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/iio/adc/ti-ads8688.c
Expand Up @@ -383,7 +383,8 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p)
{
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)];
/* Ensure naturally aligned timestamp */
u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)] __aligned(8);
int i, j = 0;

for (i = 0; i < indio_dev->masklength; i++) {
Expand Down

0 comments on commit c923e9e

Please sign in to comment.