Re: [PATCH 15/20] iio: buffer: Make timestamp s64 in iio_push_to_buffers_with_timestamp()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Dec 15, 2024 at 06:29:06PM +0000, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
> 
> This is a bit of a corner case for selecting between the in kernel types
> and standard c integer types we tend to prefer for userspace interfaces.

s/c/C/

> The interface is entirely within the kernel but in many cases the data
> ultimately ends up in userspace (via some time in a kfifo).  On balance
> the value passed is almost always an s64, so standardize on that.
> Main reason to change this is that it has led to some inconsistency in
> the storage type used.  The majority use aligned_s64 rather than
> int64_t __aligned(8) and this will ensure there is one obvious choice.

...

>  static inline int iio_push_to_buffers_with_timestamp(struct iio_dev *indio_dev,
> -	void *data, int64_t timestamp)
> +	void *data, s64 timestamp)

Hmm... Is it the indentation used for other static inline definitions there?
Otherwise I would fix it to follow standard pattern (use same column as the
first argument).

...

>  	if (indio_dev->scan_timestamp) {
> -		size_t ts_offset = indio_dev->scan_bytes / sizeof(int64_t) - 1;
> -		((int64_t *)data)[ts_offset] = timestamp;
> +		size_t ts_offset = indio_dev->scan_bytes / sizeof(s64) - 1;

sizeof(timestamp) ?

> +		((s64 *)data)[ts_offset] = timestamp;
>  	}

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux