public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3]: fix unnecessary includes and add missing ones across multiple drivers
@ 2026-04-26 21:17 Caio Morais
  2026-04-26 21:18 ` [PATCH 1/3] iio: adc: xilinx-xadc: remove unnecessary includes and add missing ones Caio Morais
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Caio Morais @ 2026-04-26 21:17 UTC (permalink / raw)
  To: andy, dlechner, jic23, michal.simek, nuno.sa
  Cc: Caio Morais, linux-arm-kernel, linux-iio

From: Caio Morais <caiomorais@usp.br>

This series removes unnecessary includes and adds missing ones as reported
by the include-what-you-use (IWYU) tool across different IIO drivers.

Caio Morais (3):
  iio: adc: xilinx-xadc: remove unnecessary includes and add missing
    ones
  iio: buffer: industrialio-triggered-buffer: fix includes with IWYU
  iio: common: st_sensors: fix includes with IWYU

 drivers/iio/adc/xilinx-xadc-events.c               | 6 +++++-
 drivers/iio/buffer/industrialio-triggered-buffer.c | 6 ++++--
 drivers/iio/common/st_sensors/st_sensors_i2c.c     | 7 +++++--
 drivers/iio/common/st_sensors/st_sensors_spi.c     | 9 +++++++--
 4 files changed, 21 insertions(+), 7 deletions(-)

-- 
2.54.0



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/3] iio: adc: xilinx-xadc: remove unnecessary includes and add missing ones
  2026-04-26 21:17 [PATCH v2 0/3]: fix unnecessary includes and add missing ones across multiple drivers Caio Morais
@ 2026-04-26 21:18 ` Caio Morais
  2026-04-27  6:42   ` Joshua Crofts
  2026-04-26 21:18 ` [PATCH 2/3] iio: buffer: industrialio-triggered-buffer: fix includes with IWYU Caio Morais
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Caio Morais @ 2026-04-26 21:18 UTC (permalink / raw)
  To: andy, dlechner, jic23, michal.simek, nuno.sa
  Cc: Caio Morais, linux-arm-kernel, linux-iio

From: Caio Morais <caiomorais@usp.br>

Signed-off-by: Caio Morais <caiomorais@usp.br>
---
 drivers/iio/adc/xilinx-xadc-events.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/xilinx-xadc-events.c b/drivers/iio/adc/xilinx-xadc-events.c
index c188d3dca..31cda8e69 100644
--- a/drivers/iio/adc/xilinx-xadc-events.c
+++ b/drivers/iio/adc/xilinx-xadc-events.c
@@ -6,9 +6,13 @@
  *  Author: Lars-Peter Clausen <lars@metafoo.de>
  */
 
+#include <linux/bitmap.h>
+#include <linux/errno.h>
+#include <linux/mutex.h>
+#include <linux/types.h>
+
 #include <linux/iio/events.h>
 #include <linux/iio/iio.h>
-#include <linux/kernel.h>
 
 #include "xilinx-xadc.h"
 
-- 
2.54.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/3] iio: buffer: industrialio-triggered-buffer: fix includes with IWYU
  2026-04-26 21:17 [PATCH v2 0/3]: fix unnecessary includes and add missing ones across multiple drivers Caio Morais
  2026-04-26 21:18 ` [PATCH 1/3] iio: adc: xilinx-xadc: remove unnecessary includes and add missing ones Caio Morais
@ 2026-04-26 21:18 ` Caio Morais
  2026-04-27  9:59   ` Andy Shevchenko
  2026-04-27 10:08   ` Jonathan Cameron
  2026-04-26 21:18 ` [PATCH 3/3] iio: common: st_sensors: " Caio Morais
  2026-04-27 10:03 ` [PATCH v2 0/3]: fix unnecessary includes and add missing ones across multiple drivers Jonathan Cameron
  3 siblings, 2 replies; 12+ messages in thread
From: Caio Morais @ 2026-04-26 21:18 UTC (permalink / raw)
  To: andy, dlechner, jic23, michal.simek, nuno.sa
  Cc: Caio Morais, linux-arm-kernel, linux-iio

From: Caio Morais <caiomorais@usp.br>

Signed-off-by: Caio Morais <caiomorais@usp.br>
---
 drivers/iio/buffer/industrialio-triggered-buffer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/buffer/industrialio-triggered-buffer.c b/drivers/iio/buffer/industrialio-triggered-buffer.c
index 9bf75dee7..a91d439d7 100644
--- a/drivers/iio/buffer/industrialio-triggered-buffer.c
+++ b/drivers/iio/buffer/industrialio-triggered-buffer.c
@@ -4,9 +4,11 @@
  *  Author: Lars-Peter Clausen <lars@metafoo.de>
  */
 
-#include <linux/kernel.h>
-#include <linux/export.h>
+#include <linux/errno.h>
+#include <linux/linkage.h>
 #include <linux/module.h>
+#include <linux/stddef.h>
+
 #include <linux/iio/iio.h>
 #include <linux/iio/buffer.h>
 #include <linux/iio/buffer_impl.h>
-- 
2.54.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3] iio: common: st_sensors: fix includes with IWYU
  2026-04-26 21:17 [PATCH v2 0/3]: fix unnecessary includes and add missing ones across multiple drivers Caio Morais
  2026-04-26 21:18 ` [PATCH 1/3] iio: adc: xilinx-xadc: remove unnecessary includes and add missing ones Caio Morais
  2026-04-26 21:18 ` [PATCH 2/3] iio: buffer: industrialio-triggered-buffer: fix includes with IWYU Caio Morais
@ 2026-04-26 21:18 ` Caio Morais
  2026-04-27 10:10   ` Jonathan Cameron
  2026-04-27 10:03 ` [PATCH v2 0/3]: fix unnecessary includes and add missing ones across multiple drivers Jonathan Cameron
  3 siblings, 1 reply; 12+ messages in thread
From: Caio Morais @ 2026-04-26 21:18 UTC (permalink / raw)
  To: andy, dlechner, jic23, michal.simek, nuno.sa
  Cc: Caio Morais, linux-arm-kernel, linux-iio

From: Caio Morais <caiomorais@usp.br>

Signed-off-by: Caio Morais <caiomorais@usp.br>
---
 drivers/iio/common/st_sensors/st_sensors_i2c.c | 7 +++++--
 drivers/iio/common/st_sensors/st_sensors_spi.c | 9 +++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/common/st_sensors/st_sensors_i2c.c b/drivers/iio/common/st_sensors/st_sensors_i2c.c
index 7156302fe..04d106def 100644
--- a/drivers/iio/common/st_sensors/st_sensors_i2c.c
+++ b/drivers/iio/common/st_sensors/st_sensors_i2c.c
@@ -7,12 +7,15 @@
  * Denis Ciocca <denis.ciocca@st.com>
  */
 
+#include <linux/device.h>
+#include <linux/err.h>
 #include <linux/i2c.h>
-#include <linux/kernel.h>
+#include <linux/linkage.h>
 #include <linux/module.h>
-#include <linux/iio/iio.h>
 #include <linux/regmap.h>
 
+#include <linux/iio/iio.h>
+
 #include <linux/iio/common/st_sensors_i2c.h>
 
 #define ST_SENSORS_I2C_MULTIREAD	0x80
diff --git a/drivers/iio/common/st_sensors/st_sensors_spi.c b/drivers/iio/common/st_sensors/st_sensors_spi.c
index 0da270139..884077d51 100644
--- a/drivers/iio/common/st_sensors/st_sensors_spi.c
+++ b/drivers/iio/common/st_sensors/st_sensors_spi.c
@@ -7,12 +7,17 @@
  * Denis Ciocca <denis.ciocca@st.com>
  */
 
-#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/linkage.h>
 #include <linux/module.h>
-#include <linux/iio/iio.h>
 #include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/spi/spi.h>
+#include <linux/stddef.h>
+#include <linux/types.h>
+
+#include <linux/iio/iio.h>
 
 #include <linux/iio/common/st_sensors_spi.h>
 
-- 
2.54.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] iio: adc: xilinx-xadc: remove unnecessary includes and add missing ones
  2026-04-26 21:18 ` [PATCH 1/3] iio: adc: xilinx-xadc: remove unnecessary includes and add missing ones Caio Morais
@ 2026-04-27  6:42   ` Joshua Crofts
  2026-04-27  9:50     ` Andy Shevchenko
  2026-04-27 10:05     ` Jonathan Cameron
  0 siblings, 2 replies; 12+ messages in thread
From: Joshua Crofts @ 2026-04-27  6:42 UTC (permalink / raw)
  To: Caio Morais
  Cc: andy, dlechner, jic23, michal.simek, nuno.sa, linux-arm-kernel,
	linux-iio

On Sun, 26 Apr 2026 at 23:20, Caio Morais <caiomorais@usp.br> wrote:
>
> From: Caio Morais <caiomorais@usp.br>
>
> Signed-off-by: Caio Morais <caiomorais@usp.br>
> ---

You're missing the commit message body. While it's understandable
what changes you've done in this patch, it's good to expand the idea
further (what you did, how you did it, why you did it). This goes for all
of the patches in your series.

> +#include <linux/bitmap.h>
> +#include <linux/errno.h>
> +#include <linux/mutex.h>
> +#include <linux/types.h>
> +
>  #include <linux/iio/events.h>
>  #include <linux/iio/iio.h>
> -#include <linux/kernel.h>
>
>  #include "xilinx-xadc.h"
>
> --
> 2.54.0
>
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] iio: adc: xilinx-xadc: remove unnecessary includes and add missing ones
  2026-04-27  6:42   ` Joshua Crofts
@ 2026-04-27  9:50     ` Andy Shevchenko
  2026-04-27 10:00       ` Joshua Crofts
  2026-04-27 10:05     ` Jonathan Cameron
  1 sibling, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2026-04-27  9:50 UTC (permalink / raw)
  To: Joshua Crofts
  Cc: Caio Morais, andy, dlechner, jic23, michal.simek, nuno.sa,
	linux-arm-kernel, linux-iio

On Mon, Apr 27, 2026 at 08:42:55AM +0200, Joshua Crofts wrote:
> On Sun, 26 Apr 2026 at 23:20, Caio Morais <caiomorais@usp.br> wrote:
> >
> > Signed-off-by: Caio Morais <caiomorais@usp.br>
> > ---
> 
> You're missing the commit message body. While it's understandable
> what changes you've done in this patch, it's good to expand the idea
> further (what you did, how you did it, why you did it). This goes for all
> of the patches in your series.

Dunno if it's your first review (congrats in that case!), but I fully agree with.
We do not accept patches with the empty commit message bodies.
(*Yes, it used to be okay twenty ears ago, but now.)


-- 
With Best Regards,
Andy Shevchenko




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] iio: buffer: industrialio-triggered-buffer: fix includes with IWYU
  2026-04-26 21:18 ` [PATCH 2/3] iio: buffer: industrialio-triggered-buffer: fix includes with IWYU Caio Morais
@ 2026-04-27  9:59   ` Andy Shevchenko
  2026-04-27 10:08   ` Jonathan Cameron
  1 sibling, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2026-04-27  9:59 UTC (permalink / raw)
  To: Caio Morais
  Cc: andy, dlechner, jic23, michal.simek, nuno.sa, linux-arm-kernel,
	linux-iio

On Sun, Apr 26, 2026 at 06:18:01PM -0300, Caio Morais wrote:

...

> -#include <linux/kernel.h>
> -#include <linux/export.h>
> +#include <linux/errno.h>

> +#include <linux/linkage.h>

Hmm... This one rarely appears in the drivers. What do we get from it here?

>  #include <linux/module.h>
> +#include <linux/stddef.h>

This one for NULL, for example, which is fine.

-- 
With Best Regards,
Andy Shevchenko




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] iio: adc: xilinx-xadc: remove unnecessary includes and add missing ones
  2026-04-27  9:50     ` Andy Shevchenko
@ 2026-04-27 10:00       ` Joshua Crofts
  0 siblings, 0 replies; 12+ messages in thread
From: Joshua Crofts @ 2026-04-27 10:00 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Caio Morais, andy, dlechner, jic23, michal.simek, nuno.sa,
	linux-arm-kernel, linux-iio

On Mon, 27 Apr 2026 at 11:50, Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:

> Dunno if it's your first review (congrats in that case!), but I fully agree with.

Yes, this is my first review :)

> We do not accept patches with the empty commit message bodies.
> (*Yes, it used to be okay twenty ears ago, but now.)

I maybe also take issue with the fact that the series (although they are
the same logical change) is composed of changes in different iio
subsystems (adc, buffer and common). Shouldn't these be sent
separately?

-- 
Kind regards

CJD


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 0/3]: fix unnecessary includes and add missing ones across multiple drivers
  2026-04-26 21:17 [PATCH v2 0/3]: fix unnecessary includes and add missing ones across multiple drivers Caio Morais
                   ` (2 preceding siblings ...)
  2026-04-26 21:18 ` [PATCH 3/3] iio: common: st_sensors: " Caio Morais
@ 2026-04-27 10:03 ` Jonathan Cameron
  3 siblings, 0 replies; 12+ messages in thread
From: Jonathan Cameron @ 2026-04-27 10:03 UTC (permalink / raw)
  To: Caio Morais
  Cc: andy, dlechner, michal.simek, nuno.sa, linux-arm-kernel,
	linux-iio

On Sun, 26 Apr 2026 18:17:59 -0300
Caio Morais <caiomorais@usp.br> wrote:

> From: Caio Morais <caiomorais@usp.br>
> 
> This series removes unnecessary includes and adds missing ones as reported
> by the include-what-you-use (IWYU) tool across different IIO drivers.

One series per driver.  Having a shared one for the core is fine but definitely
don't mix core and drivers. Tend to have entirely different sets of
reviewers!

J
> 
> Caio Morais (3):
>   iio: adc: xilinx-xadc: remove unnecessary includes and add missing
>     ones
>   iio: buffer: industrialio-triggered-buffer: fix includes with IWYU
>   iio: common: st_sensors: fix includes with IWYU
> 
>  drivers/iio/adc/xilinx-xadc-events.c               | 6 +++++-
>  drivers/iio/buffer/industrialio-triggered-buffer.c | 6 ++++--
>  drivers/iio/common/st_sensors/st_sensors_i2c.c     | 7 +++++--
>  drivers/iio/common/st_sensors/st_sensors_spi.c     | 9 +++++++--
>  4 files changed, 21 insertions(+), 7 deletions(-)
> 



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] iio: adc: xilinx-xadc: remove unnecessary includes and add missing ones
  2026-04-27  6:42   ` Joshua Crofts
  2026-04-27  9:50     ` Andy Shevchenko
@ 2026-04-27 10:05     ` Jonathan Cameron
  1 sibling, 0 replies; 12+ messages in thread
From: Jonathan Cameron @ 2026-04-27 10:05 UTC (permalink / raw)
  To: Joshua Crofts
  Cc: Caio Morais, andy, dlechner, michal.simek, nuno.sa,
	linux-arm-kernel, linux-iio

On Mon, 27 Apr 2026 08:42:55 +0200
Joshua Crofts <joshua.crofts1@gmail.com> wrote:

> On Sun, 26 Apr 2026 at 23:20, Caio Morais <caiomorais@usp.br> wrote:
> >
> > From: Caio Morais <caiomorais@usp.br>
> >
> > Signed-off-by: Caio Morais <caiomorais@usp.br>
> > ---  
> 
> You're missing the commit message body. While it's understandable
> what changes you've done in this patch, it's good to expand the idea
> further (what you did, how you did it, why you did it). This goes for all
> of the patches in your series.

Also, why only this file of the several that make up that driver?
Looks like kernel.h is included in xilinx-xadc-core.c as well.

I'd talk about kernel.h specifically in the patch description and
why stopping including that is seen as a nice to have.

> 
> > +#include <linux/bitmap.h>
> > +#include <linux/errno.h>
> > +#include <linux/mutex.h>
> > +#include <linux/types.h>
> > +
> >  #include <linux/iio/events.h>
> >  #include <linux/iio/iio.h>
> > -#include <linux/kernel.h>
> >
> >  #include "xilinx-xadc.h"
> >
> > --
> > 2.54.0
> >
> >  



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] iio: buffer: industrialio-triggered-buffer: fix includes with IWYU
  2026-04-26 21:18 ` [PATCH 2/3] iio: buffer: industrialio-triggered-buffer: fix includes with IWYU Caio Morais
  2026-04-27  9:59   ` Andy Shevchenko
@ 2026-04-27 10:08   ` Jonathan Cameron
  1 sibling, 0 replies; 12+ messages in thread
From: Jonathan Cameron @ 2026-04-27 10:08 UTC (permalink / raw)
  To: Caio Morais
  Cc: andy, dlechner, michal.simek, nuno.sa, linux-arm-kernel,
	linux-iio

On Sun, 26 Apr 2026 18:18:01 -0300
Caio Morais <caiomorais@usp.br> wrote:

> From: Caio Morais <caiomorais@usp.br>
> 
> Signed-off-by: Caio Morais <caiomorais@usp.br>
> ---
>  drivers/iio/buffer/industrialio-triggered-buffer.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/buffer/industrialio-triggered-buffer.c b/drivers/iio/buffer/industrialio-triggered-buffer.c
> index 9bf75dee7..a91d439d7 100644
> --- a/drivers/iio/buffer/industrialio-triggered-buffer.c
> +++ b/drivers/iio/buffer/industrialio-triggered-buffer.c
> @@ -4,9 +4,11 @@
>   *  Author: Lars-Peter Clausen <lars@metafoo.de>
>   */
>  
> -#include <linux/kernel.h>
> -#include <linux/export.h>

Why?  There are numerous uses of EXPORT_SYMBOL() in this file.

> +#include <linux/errno.h>
> +#include <linux/linkage.h>

Wow. That one is obscure.  What needed that?  

For these, IWYU patches, I prefer to add that info after the ---
so it's easy to review them without opening the code up to take a closer look.

>  #include <linux/module.h>
> +#include <linux/stddef.h>
> +
>  #include <linux/iio/iio.h>
>  #include <linux/iio/buffer.h>
>  #include <linux/iio/buffer_impl.h>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] iio: common: st_sensors: fix includes with IWYU
  2026-04-26 21:18 ` [PATCH 3/3] iio: common: st_sensors: " Caio Morais
@ 2026-04-27 10:10   ` Jonathan Cameron
  0 siblings, 0 replies; 12+ messages in thread
From: Jonathan Cameron @ 2026-04-27 10:10 UTC (permalink / raw)
  To: Caio Morais
  Cc: andy, dlechner, michal.simek, nuno.sa, linux-arm-kernel,
	linux-iio

On Sun, 26 Apr 2026 18:18:02 -0300
Caio Morais <caiomorais@usp.br> wrote:

> From: Caio Morais <caiomorais@usp.br>
> 
> Signed-off-by: Caio Morais <caiomorais@usp.br>
> ---
>  drivers/iio/common/st_sensors/st_sensors_i2c.c | 7 +++++--
>  drivers/iio/common/st_sensors/st_sensors_spi.c | 9 +++++++--
>  2 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/common/st_sensors/st_sensors_i2c.c b/drivers/iio/common/st_sensors/st_sensors_i2c.c
> index 7156302fe..04d106def 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_i2c.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_i2c.c
> @@ -7,12 +7,15 @@
>   * Denis Ciocca <denis.ciocca@st.com>
>   */
>  
> +#include <linux/device.h>
> +#include <linux/err.h>
>  #include <linux/i2c.h>
> -#include <linux/kernel.h>
> +#include <linux/linkage.h>
>  #include <linux/module.h>
> -#include <linux/iio/iio.h>
>  #include <linux/regmap.h>
>  
> +#include <linux/iio/iio.h>
> +
>  #include <linux/iio/common/st_sensors_i2c.h>
>  
>  #define ST_SENSORS_I2C_MULTIREAD	0x80
> diff --git a/drivers/iio/common/st_sensors/st_sensors_spi.c b/drivers/iio/common/st_sensors/st_sensors_spi.c
> index 0da270139..884077d51 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_spi.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_spi.c
> @@ -7,12 +7,17 @@
>   * Denis Ciocca <denis.ciocca@st.com>
>   */
>  
> -#include <linux/kernel.h>
> +#include <linux/device.h>
This one is similar to kernel.h in that it's mostly a catch all header
that we prefer to replace if possible with more specific ones.

Now the driver might directly dereference a struct device, but if
so that normally indicates something we should clean up.
Maybe it's something else.  As mentioned in previous review
providing that info under the --- in the patch can save time on
questions like this.

> +#include <linux/err.h>
> +#include <linux/linkage.h>
>  #include <linux/module.h>
> -#include <linux/iio/iio.h>
>  #include <linux/property.h>
>  #include <linux/regmap.h>
>  #include <linux/spi/spi.h>
> +#include <linux/stddef.h>
> +#include <linux/types.h>
> +
> +#include <linux/iio/iio.h>
>  
>  #include <linux/iio/common/st_sensors_spi.h>
>  



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-04-27 10:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-26 21:17 [PATCH v2 0/3]: fix unnecessary includes and add missing ones across multiple drivers Caio Morais
2026-04-26 21:18 ` [PATCH 1/3] iio: adc: xilinx-xadc: remove unnecessary includes and add missing ones Caio Morais
2026-04-27  6:42   ` Joshua Crofts
2026-04-27  9:50     ` Andy Shevchenko
2026-04-27 10:00       ` Joshua Crofts
2026-04-27 10:05     ` Jonathan Cameron
2026-04-26 21:18 ` [PATCH 2/3] iio: buffer: industrialio-triggered-buffer: fix includes with IWYU Caio Morais
2026-04-27  9:59   ` Andy Shevchenko
2026-04-27 10:08   ` Jonathan Cameron
2026-04-26 21:18 ` [PATCH 3/3] iio: common: st_sensors: " Caio Morais
2026-04-27 10:10   ` Jonathan Cameron
2026-04-27 10:03 ` [PATCH v2 0/3]: fix unnecessary includes and add missing ones across multiple drivers Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox