Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: imu: inv_icm42600: reorganize DMA aligned buffers in structure

Move all DMA aligned buffers together at the end of the structure.

1. Timestamp anynomous structure is not used with DMA so it doesn't
belong after __aligned(IIO_DMA_MINALIGN).
2. struct inv_icm42600_fifo contains it's own __aligned(IIO_DMA_MINALIGN)
within it at the end so it should not be after __aligned(IIO_DMA_MINALIGN)
in the outer struct either.
3. Normally 1 would have been considered a bug, but because of the extra
alignment from 2, it actually was OK, but we shouldn't be relying on such
quirks.

Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://patch.msgid.link/20250630-losd-3-inv-icm42600-add-wom-support-v6-1-5bb0c84800d9@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Jean-Baptiste Maneyrol and committed by
Jonathan Cameron
0c122c28 f057897d

+4 -4
+4 -4
drivers/iio/imu/inv_icm42600/inv_icm42600.h
··· 148 148 * @suspended: suspended sensors configuration. 149 149 * @indio_gyro: gyroscope IIO device. 150 150 * @indio_accel: accelerometer IIO device. 151 - * @buffer: data transfer buffer aligned for DMA. 152 - * @fifo: FIFO management structure. 153 151 * @timestamp: interrupt timestamps. 152 + * @fifo: FIFO management structure. 153 + * @buffer: data transfer buffer aligned for DMA. 154 154 */ 155 155 struct inv_icm42600_state { 156 156 struct mutex lock; ··· 164 164 struct inv_icm42600_suspended suspended; 165 165 struct iio_dev *indio_gyro; 166 166 struct iio_dev *indio_accel; 167 - u8 buffer[2] __aligned(IIO_DMA_MINALIGN); 168 - struct inv_icm42600_fifo fifo; 169 167 struct { 170 168 s64 gyro; 171 169 s64 accel; 172 170 } timestamp; 171 + struct inv_icm42600_fifo fifo; 172 + u8 buffer[2] __aligned(IIO_DMA_MINALIGN); 173 173 }; 174 174 175 175