android_kernel_xiaomi_sm7250/drivers/iio/pressure
Jonathan Cameron e4c3573b76 iio:pressure:mpl3115: Force alignment of buffer
commit 198cf32f0503d2ad60d320b95ef6fb8243db857f upstream.

Whilst this is another case of the issue Lars reported with
an array of elements of smaller than 8 bytes being passed
to iio_push_to_buffers_with_timestamp(), the solution here is
a bit different from the other cases and relies on __aligned
working on the stack (true since 4.6?)

This one is unusual.  We have to do an explicit memset() each time
as we are reading 3 bytes into a potential 4 byte channel which
may sometimes be a 2 byte channel depending on what is enabled.
As such, moving the buffer to the heap in the iio_priv structure
doesn't save us much.  We can't use a nice explicit structure
on the stack either as the data channels have different storage
sizes and are all separately controlled.

Fixes: cc26ad455f ("iio: Add Freescale MPL3115A2 pressure / temperature sensor driver")
Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200920112742.170751-7-jic23@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-30 11:26:16 +01:00
..
abp060mg.c
bmp280-core.c iio: bmp280: fix compensation of humidity 2020-06-25 15:32:49 +02:00
bmp280-i2c.c
bmp280-regmap.c
bmp280-spi.c
bmp280.h
cros_ec_baro.c
hid-sensor-press.c iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbers 2018-12-05 19:32:13 +01:00
hp03.c
hp206c.c
Kconfig
Makefile
mpl115_i2c.c
mpl115_spi.c
mpl115.c
mpl115.h
mpl3115.c iio:pressure:mpl3115: Force alignment of buffer 2020-12-30 11:26:16 +01:00
ms5611_core.c iio:pressure:ms5611 Fix buffer element alignment 2020-07-22 09:32:02 +02:00
ms5611_i2c.c
ms5611_spi.c
ms5611.h
ms5637.c
st_pressure_buffer.c
st_pressure_core.c
st_pressure_i2c.c
st_pressure_spi.c
st_pressure.h
t5403.c
zpa2326_i2c.c
zpa2326_spi.c
zpa2326.c iio: pressure: zpa2326: handle pm_runtime_get_sync failure 2020-07-22 09:32:02 +02:00
zpa2326.h