]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
iio: potentiostat: lmp91000: Fix alignment of buffer in iio_push_to_buffers_with_time...
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 1 May 2021 17:13:48 +0000 (18:13 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:31:15 +0000 (09:31 +0200)
BugLink: https://bugs.launchpad.net/bugs/1938340
[ Upstream commit 8979b67ec61abc232636400ee8c758a16a73c95f ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/iio/potentiostat/lmp91000.c

index f34ca769dc20de80c0d641f809f0b44bb507e683..d7ff74a798ba38d8e491abcb864f4d3339009420 100644 (file)
@@ -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[] = {