Re: [PATCH 01/32] iio: accel: kxsd9: Fix alignment of local buffer.

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

 



On Sun, Jun 7, 2020 at 6:57 PM Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
>
> iio_push_to_buffers_with_timestamp assumes 8 byte alignment which
> is not guaranteed by an array of smaller elements.
>
> Note that whilst in this particular case the alignment forcing
> of the ts element is not strictly necessary it acts as good
> documentation.

...

> +       struct {
> +               __be16 chan[4];
> +               s64 ts __aligned(8);
> +       } hw_values;

I'm not sure what __aligned can do better here? It's naturally will be
8 alignment (struct itself due to s64 followed by 4*__be16).

-- 
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