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

Nuno Sá noname.nuno at gmail.com
Fri Apr 18 02:17:46 PDT 2025


On Thu, 2025-04-17 at 15:48 -0500, David Lechner wrote:
> On 4/17/25 12:44 PM, Jonathan Cameron wrote:
> > On Thu, 17 Apr 2025 12:07:37 -0500
> > David Lechner <dlechner at baylibre.com> wrote:
> > 
> > > On 4/17/25 11:59 AM, Andy Shevchenko wrote:
> > > > 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.  
> > > 
> > > Oops, sure enough.
> > > 
> > > > 
> > > > ...
> > > >   
> > > > >  	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?  
> > > 
> > > I do personally prefer the struct pattern, but there are very many other
> > > drivers
> > > using this buffer pattern that I was not tempted to try to start converting
> > > them.
> > 
> > For drivers like this one where there is no room for the timestamp
> > to sit earlier for minimal channels I think it is worth that conversion
> > if we are touching them anyway. 
> > 
> > Jonathan
> > 
> There is actually a lot more wrong in this driver, so will save that for a
> separate series.
> 

I think one of them is actually leaking some memory into userspace...

- Nuno Sá




More information about the linux-arm-kernel mailing list