lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241012130402.450b7181@jic23-huawei>
Date: Sat, 12 Oct 2024 13:04:02 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Vasileios Aoiridis <vassilisamir@...il.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, lars@...afoo.de,
 robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
 anshulusr@...il.com, gustavograzs@...il.com, linux-iio@...r.kernel.org,
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 12/13] iio: chemical: bme680: Add triggered buffer
 support

On Fri, 11 Oct 2024 21:07:20 +0200
Vasileios Aoiridis <vassilisamir@...il.com> wrote:

> On Fri, Oct 11, 2024 at 01:37:56PM +0300, Andy Shevchenko wrote:
> > On Thu, Oct 10, 2024 at 11:00:29PM +0200, vamoirid wrote:  
> > > From: Vasileios Amoiridis <vassilisamir@...il.com>
> > > 
> > > Add triggered buffer and soft timestamp support. The available scan mask
> > > enables all the channels of the sensor in order to follow the operation of
> > > the sensor. The sensor basically starts to capture from all channels
> > > as long as it enters into FORCED mode.  
> > 
> > ...
> >   
> > >  	struct regulator_bulk_data supplies[BME680_NUM_SUPPLIES];
> > >  	int ambient_temp;
> > >  
> > > +	u8 buffer[ALIGN(sizeof(s32) * BME680_NUM_CHANNELS, sizeof(s64))
> > > +		  + sizeof(s64)] __aligned(sizeof(s64));  
> > 
> > Can it be represented as a structure?
> > We also have aligned_s64 for the timestamp.
> >  
> 
> Hi Andy,
> 
> The same approach was used also for the bmp280 driver and since I was
> working on the bmp280 as well, I did it here. You think the
> representation as a struct would look better? Personally I like the
> nature of this one because of the ALIGN() but I have no problem of using
> a struct here.

Depends if you can enable sufficiently few channels that the timestamp
moves.  If that is the case, a structure is missleading as a representation
of this buffer so I prefer the above fun as it doesn't give the wrong
impression (by giving no impression at all of the data layout!)

Jonathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ