]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
iio: accel: hid: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 1 May 2021 17:01:05 +0000 (18:01 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:46:00 +0000 (09:46 +0200)
commitb70b85cb4f5e27e53c8456a6c6e7856dce64886b
tree00bd8ecd2515bc40842c9d1d82cccbe8fdfb2a0d
parent6b1b2480aef38fff245fc2f847c92f5405293a3c
iio: accel: hid: Fix buffer alignment in iio_push_to_buffers_with_timestamp()

BugLink: https://bugs.launchpad.net/bugs/1938199
[ Upstream commit c6559bf796ccdb3a0c79db846af96c8f7046880b ]

To make code more readable, use a structure to express the channel
layout and ensure the timestamp is 8 byte aligned.
Note this matches what was done in all the other hid sensor drivers.
This one was missed previously due to an extra level of indirection.

Found during an audit of all calls of this function.

Fixes: a96cd0f901ee ("iio: accel: hid-sensor-accel-3d: Add timestamp")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210501170121.512209-4-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/accel/hid-sensor-accel-3d.c