Skip to content

Commit

Permalink
iio: potentiostat: lmp91000: Fix alignment of buffer in iio_push_to_b…
Browse files Browse the repository at this point in the history
…uffers_with_timestamp()

[ Upstream commit 8979b67 ]

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: 67e1730 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jic23 authored and gregkh committed Jul 14, 2021
1 parent 71dbba0 commit 246b4f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iio/potentiostat/lmp91000.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ struct lmp91000_data {

struct completion completion;
u8 chan_select;

u32 buffer[4]; /* 64-bit data + 64-bit timestamp */
/* 64-bit data + 64-bit naturally aligned timestamp */
u32 buffer[4] __aligned(8);
};

static const struct iio_chan_spec lmp91000_channels[] = {
Expand Down

0 comments on commit 246b4f1

Please sign in to comment.