linux/drivers/iio/imu/bno055
David Lechner 773ef9f953 iio: imu: bno055: fix BNO055_SCAN_CH_COUNT off by one
Fix an off-by-one error in the BNO055_SCAN_CH_COUNT macro. The count
is derived by taking the difference of the last and first register
addresses, dividing by the size of each channel (2 bytes). It needs to
also add 1 to account for the fact that the count is inclusive of both
the first and last channels.

Thanks to the aligned_s64 timestamp field, there was already extra
padding in the buffer, so there were no runtime issues caused by this
bug.

Fixes: 4aefe1c2bd ("iio: imu: add Bosch Sensortec BNO055 core driver")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01 12:25:43 +00:00
..
bno055_i2c.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
bno055_ser_core.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
bno055_ser_trace.c iio: imu: fix spdx format 2023-01-28 16:22:46 +00:00
bno055_ser_trace.h
bno055.c iio: imu: bno055: fix BNO055_SCAN_CH_COUNT off by one 2026-03-01 12:25:43 +00:00
bno055.h
Kconfig iio: imu: bno055: serdev requires REGMAP 2024-01-22 18:59:07 +00:00
Makefile iio: imu: add BNO055 I2C driver 2022-09-21 18:42:56 +01:00