Re: [PATCH] iio: accel: bmc150: use IIO_DECLARE_BUFFER_WITH_TS

David Lechner <[email protected]>
Newsgroups org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 8/8/26 5:02 PM, Yash Suthar wrote:
> Replace bmc150_accel_data plain buffer with
> IIO_DECLARE_BUFFER_WITH_TS() that also keep
> timestamp aligned.

Please don't wrap the lines so short. In git commits we usually
aim for 76 columns, IIRC.

> 
> Signed-off-by: Yash Suthar <[email protected]>
> ---
>  drivers/iio/accel/bmc150-accel.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/accel/bmc150-accel.h b/drivers/iio/accel/bmc150-accel.h
> index e8f26198359f..e0773533efeb 100644
> --- a/drivers/iio/accel/bmc150-accel.h
> +++ b/drivers/iio/accel/bmc150-accel.h
> @@ -64,7 +64,7 @@ struct bmc150_accel_data {
>  	struct bmc150_accel_trigger triggers[BMC150_ACCEL_TRIGGERS];
>  	struct mutex mutex;
>  	u8 fifo_mode, watermark;
> -	s16 buffer[8];
> +	IIO_DECLARE_BUFFER_WITH_TS(s16, buffer, 3);
>  	/*
>  	 * Ensure there is sufficient space and correct alignment for
>  	 * the timestamp if enabled

Probably also needs fixes tag since the old array was not properly aligned.


And as a follow-up task (in a separate patch), we can look at replacing
iio_push_to_buffers_with_timestamp() with iio_push_to_buffers_with_ts()
in this driver. Should be trivial in this case.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.