[PATCH 6/8] iio: imu: adis16550: align buffers for timestamp

Andy Shevchenko andy at kernel.org
Thu Apr 17 09:59:37 PDT 2025


On Thu, Apr 17, 2025 at 11:52:38AM -0500, David Lechner wrote:
> Align the buffers used with iio_push_to_buffers_with_timestamp() to
> ensure the s64 timestamp is aligned to 8 bytes.
> 
>  drivers/iio/accel/bmc150-accel.h | 2 +-
>  drivers/iio/imu/adis16550.c      | 2 +-

Looks like a stray squash of the two independent commits.

...

>  	struct bmc150_accel_trigger triggers[BMC150_ACCEL_TRIGGERS];
>  	struct mutex mutex;
>  	u8 fifo_mode, watermark;
> -	s16 buffer[8];
> +	s16 buffer[8] __aligned(8);

As for the code, would it be possible to convert to actually use a sturcture
rather than an array?

...

>  	struct iio_poll_func *pf = p;
> -	__be32 data[ADIS16550_MAX_SCAN_DATA];
> +	__be32 data[ADIS16550_MAX_SCAN_DATA] __aligned(8);
>  	struct iio_dev *indio_dev = pf->indio_dev;
>  	struct adis16550 *st = iio_priv(indio_dev);

Ditto.

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-arm-kernel mailing list