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: <20250222172851.5ff3fa79@jic23-huawei>
Date: Sat, 22 Feb 2025 17:28:51 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Alex Lanzano <lanzano.alex@...il.com>
Cc: Gustavo Silva <gustavograzs@...il.com>, Lars-Peter Clausen
 <lars@...afoo.de>, linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] iio: imu: bmi270: move private struct declaration
 to source file

On Sat, 22 Feb 2025 11:25:21 -0500
Alex Lanzano <lanzano.alex@...il.com> wrote:

> On Wed, Feb 19, 2025 at 08:54:45PM -0300, Gustavo Silva wrote:
> > The device's private data struct is currently declared in the header
> > file, but it does not need to be exposed there. Move it to the driver's
> > core source file to avoid unnecessary #include directives or forward
> > declarations in the header.
> > 
> > Signed-off-by: Gustavo Silva <gustavograzs@...il.com>  
> Acked-by: Alex Lanzano <lanzano.alex@...il.com>
A good cleanup. So applied before I even look at 2 and 3!

Thanks,

Jonathan

> > ---
> >  drivers/iio/imu/bmi270/bmi270.h      | 17 +----------------
> >  drivers/iio/imu/bmi270/bmi270_core.c | 15 +++++++++++++++
> >  2 files changed, 16 insertions(+), 16 deletions(-)
> > 
> > diff --git a/drivers/iio/imu/bmi270/bmi270.h b/drivers/iio/imu/bmi270/bmi270.h
> > index fdfad5784cc52043475b6816286619fac5824684..d94525f6aee85f21cc9e9ae1bc9c1db0dc00b927 100644
> > --- a/drivers/iio/imu/bmi270/bmi270.h
> > +++ b/drivers/iio/imu/bmi270/bmi270.h
> > @@ -6,22 +6,6 @@
> >  #include <linux/regmap.h>
> >  #include <linux/iio/iio.h>
> >  
> > -struct device;
> > -struct bmi270_data {
> > -	struct device *dev;
> > -	struct regmap *regmap;
> > -	const struct bmi270_chip_info *chip_info;
> > -
> > -	/*
> > -	 * Where IIO_DMA_MINALIGN may be larger than 8 bytes, align to
> > -	 * that to ensure a DMA safe buffer.
> > -	 */
> > -	struct {
> > -		__le16 channels[6];
> > -		aligned_s64 timestamp;
> > -	} data __aligned(IIO_DMA_MINALIGN);
> > -};
> > -
> >  struct bmi270_chip_info {
> >  	const char *name;
> >  	int chip_id;
> > @@ -32,6 +16,7 @@ extern const struct regmap_config bmi270_regmap_config;
> >  extern const struct bmi270_chip_info bmi260_chip_info;
> >  extern const struct bmi270_chip_info bmi270_chip_info;
> >  
> > +struct device;
> >  int bmi270_core_probe(struct device *dev, struct regmap *regmap,
> >  		      const struct bmi270_chip_info *chip_info);
> >  
> > diff --git a/drivers/iio/imu/bmi270/bmi270_core.c b/drivers/iio/imu/bmi270/bmi270_core.c
> > index 464dcdd657c4ba27fdb7620c80e9f05e2a831910..9f24d4044ed6f00f67fd3a8f5adda821c3140a18 100644
> > --- a/drivers/iio/imu/bmi270/bmi270_core.c
> > +++ b/drivers/iio/imu/bmi270/bmi270_core.c
> > @@ -78,6 +78,21 @@
> >  #define BMI260_INIT_DATA_FILE "bmi260-init-data.fw"
> >  #define BMI270_INIT_DATA_FILE "bmi270-init-data.fw"
> >  
> > +struct bmi270_data {
> > +	struct device *dev;
> > +	struct regmap *regmap;
> > +	const struct bmi270_chip_info *chip_info;
> > +
> > +	/*
> > +	 * Where IIO_DMA_MINALIGN may be larger than 8 bytes, align to
> > +	 * that to ensure a DMA safe buffer.
> > +	 */
> > +	struct {
> > +		__le16 channels[6];
> > +		aligned_s64 timestamp;
> > +	} data __aligned(IIO_DMA_MINALIGN);
> > +};
> > +
> >  enum bmi270_scan {
> >  	BMI270_SCAN_ACCEL_X,
> >  	BMI270_SCAN_ACCEL_Y,
> > 
> > -- 
> > 2.48.1
> >   


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ