Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/2] iio: st_sensors: Remove some redundant includes
Date: Sat, 17 Jun 2023 19:47:34 +0100	[thread overview]
Message-ID: <20230617194734.5dad2f06@jic23-huawei> (raw)
In-Reply-To: <045ca726a9108325a3eaace807a264170895686c.1686600780.git.christophe.jaillet@wanadoo.fr>

On Mon, 12 Jun 2023 22:13:36 +0200
Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:

> st_sensors_(i2c|spi).h already include st_sensors.h, so there is no need
> to include it explicitly.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Mostly we try to avoid implicit includes that might not be around
for ever as it makes changing internals of headers have messy side effects.
In this particular case I'd argue that the _spi.h and _i2c.h should
not be including st_sensors.h rather than the other way around.

There is nothing in those headers that uses anything from
st_sensors.h

They should probably use forward definitions of
struct iio_dev and struct spi_device etc to avoid need to include
anything at all.

Jonathan
 


> ---
>  drivers/iio/accel/st_accel_spi.c       | 1 -
>  drivers/iio/gyro/st_gyro_i2c.c         | 1 -
>  drivers/iio/gyro/st_gyro_spi.c         | 1 -
>  drivers/iio/magnetometer/st_magn_i2c.c | 1 -
>  drivers/iio/magnetometer/st_magn_spi.c | 1 -
>  drivers/iio/pressure/st_pressure_i2c.c | 1 -
>  drivers/iio/pressure/st_pressure_spi.c | 1 -
>  7 files changed, 7 deletions(-)
> 
> diff --git a/drivers/iio/accel/st_accel_spi.c b/drivers/iio/accel/st_accel_spi.c
> index f72a24f45322..ae5bf3b47209 100644
> --- a/drivers/iio/accel/st_accel_spi.c
> +++ b/drivers/iio/accel/st_accel_spi.c
> @@ -13,7 +13,6 @@
>  #include <linux/spi/spi.h>
>  #include <linux/iio/iio.h>
>  
> -#include <linux/iio/common/st_sensors.h>
>  #include <linux/iio/common/st_sensors_spi.h>
>  #include "st_accel.h"
>  
> diff --git a/drivers/iio/gyro/st_gyro_i2c.c b/drivers/iio/gyro/st_gyro_i2c.c
> index 5a10a3556ab0..ceebd246100c 100644
> --- a/drivers/iio/gyro/st_gyro_i2c.c
> +++ b/drivers/iio/gyro/st_gyro_i2c.c
> @@ -13,7 +13,6 @@
>  #include <linux/i2c.h>
>  #include <linux/iio/iio.h>
>  
> -#include <linux/iio/common/st_sensors.h>
>  #include <linux/iio/common/st_sensors_i2c.h>
>  #include "st_gyro.h"
>  
> diff --git a/drivers/iio/gyro/st_gyro_spi.c b/drivers/iio/gyro/st_gyro_spi.c
> index 22aaabe48e4a..afdb8dffd72d 100644
> --- a/drivers/iio/gyro/st_gyro_spi.c
> +++ b/drivers/iio/gyro/st_gyro_spi.c
> @@ -13,7 +13,6 @@
>  #include <linux/spi/spi.h>
>  #include <linux/iio/iio.h>
>  
> -#include <linux/iio/common/st_sensors.h>
>  #include <linux/iio/common/st_sensors_spi.h>
>  #include "st_gyro.h"
>  
> diff --git a/drivers/iio/magnetometer/st_magn_i2c.c b/drivers/iio/magnetometer/st_magn_i2c.c
> index 950826dd20bf..b9221794cf00 100644
> --- a/drivers/iio/magnetometer/st_magn_i2c.c
> +++ b/drivers/iio/magnetometer/st_magn_i2c.c
> @@ -13,7 +13,6 @@
>  #include <linux/i2c.h>
>  #include <linux/iio/iio.h>
>  
> -#include <linux/iio/common/st_sensors.h>
>  #include <linux/iio/common/st_sensors_i2c.h>
>  #include "st_magn.h"
>  
> diff --git a/drivers/iio/magnetometer/st_magn_spi.c b/drivers/iio/magnetometer/st_magn_spi.c
> index f203e1f87eec..5540500ba9fa 100644
> --- a/drivers/iio/magnetometer/st_magn_spi.c
> +++ b/drivers/iio/magnetometer/st_magn_spi.c
> @@ -13,7 +13,6 @@
>  #include <linux/spi/spi.h>
>  #include <linux/iio/iio.h>
>  
> -#include <linux/iio/common/st_sensors.h>
>  #include <linux/iio/common/st_sensors_spi.h>
>  #include "st_magn.h"
>  
> diff --git a/drivers/iio/pressure/st_pressure_i2c.c b/drivers/iio/pressure/st_pressure_i2c.c
> index 5101552e3f38..8ba0d1212401 100644
> --- a/drivers/iio/pressure/st_pressure_i2c.c
> +++ b/drivers/iio/pressure/st_pressure_i2c.c
> @@ -14,7 +14,6 @@
>  #include <linux/i2c.h>
>  #include <linux/iio/iio.h>
>  
> -#include <linux/iio/common/st_sensors.h>
>  #include <linux/iio/common/st_sensors_i2c.h>
>  #include "st_pressure.h"
>  
> diff --git a/drivers/iio/pressure/st_pressure_spi.c b/drivers/iio/pressure/st_pressure_spi.c
> index 25cca5ad7c55..ffa1970a5aeb 100644
> --- a/drivers/iio/pressure/st_pressure_spi.c
> +++ b/drivers/iio/pressure/st_pressure_spi.c
> @@ -13,7 +13,6 @@
>  #include <linux/spi/spi.h>
>  #include <linux/iio/iio.h>
>  
> -#include <linux/iio/common/st_sensors.h>
>  #include <linux/iio/common/st_sensors_spi.h>
>  #include "st_pressure.h"
>  


      parent reply	other threads:[~2023-06-17 18:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 20:13 [PATCH 1/2] iio: st_sensors: Remove some redundant includes Christophe JAILLET
2023-06-12 20:13 ` [PATCH 2/2] iio: st_sensors: Remove some redundant includes in st_sensors.h Christophe JAILLET
2023-06-17 18:49   ` Jonathan Cameron
2023-06-19 20:02     ` Christophe JAILLET
2023-07-02 10:31       ` Jonathan Cameron
2023-06-17 18:47 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230617194734.5dad2f06@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox