Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v2 09/11] iio: temperature: tsys01: make headers conform to IWYU
  2026-08-29 16:25 Joshua Crofts
@ 2026-08-29 16:26 ` Joshua Crofts
  2026-08-29 17:57   ` Jonathan Cameron
  0 siblings, 1 reply; 17+ messages in thread
From: Joshua Crofts @ 2026-08-29 16:26 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

Remove the catch-all kernel.h header, add missing headers and remove
unused headers.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
Header changes explained:
Added:
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/i2c.h>: for i2c_client and i2c_device_id
- <linux/math64.h>: for div64 functions
- <linux/sprintf.h>: for sprintf functions
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.)
Removed:
- <linux/init.h>: not directly used in this driver
- <linux/kernel.h>: catch-all header no longer needed
- <linux/property.h>: not directly used in this driver
- <linux/stat.h>: not directly used in this driver
---
 drivers/iio/temperature/tmp117.c |  3 +--
 drivers/iio/temperature/tsys01.c | 10 ++++++----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/temperature/tmp117.c b/drivers/iio/temperature/tmp117.c
index 25bc98e64e48..96252627613f 100644
--- a/drivers/iio/temperature/tmp117.c
+++ b/drivers/iio/temperature/tmp117.c
@@ -12,13 +12,12 @@
 #include <linux/array_size.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
-#include <linux/dev_printk.h>
+#include <linux/device.h>
 #include <linux/err.h>
 #include <linux/i2c.h>
 #include <linux/limits.h>
 #include <linux/minmax.h>
 #include <linux/module.h>
-#include <linux/property.h>
 #include <linux/regulator/consumer.h>
 #include <linux/types.h>
 
diff --git a/drivers/iio/temperature/tsys01.c b/drivers/iio/temperature/tsys01.c
index 14de67ee8be7..3c1f5b6ac156 100644
--- a/drivers/iio/temperature/tsys01.c
+++ b/drivers/iio/temperature/tsys01.c
@@ -8,12 +8,14 @@
  *  http://www.meas-spec.com/downloads/TSYS01_Digital_Temperature_Sensor.pdf
  */
 
-#include <linux/device.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
+#include <linux/array_size.h>
+#include <linux/dev_printk.h>
+#include <linux/i2c.h>
+#include <linux/math64.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
-#include <linux/stat.h>
+#include <linux/sprintf.h>
+#include <linux/types.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>

-- 
2.55.0


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

* Re: [PATCH v2 09/11] iio: temperature: tsys01: make headers conform to IWYU
  2026-08-29 16:26 ` [PATCH v2 09/11] iio: temperature: tsys01: " Joshua Crofts
@ 2026-08-29 17:57   ` Jonathan Cameron
  2026-08-29 18:09     ` Joshua Crofts
  0 siblings, 1 reply; 17+ messages in thread
From: Jonathan Cameron @ 2026-08-29 17:57 UTC (permalink / raw)
  To: Joshua Crofts
  Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan, linux-iio, linux-kernel

> Remove the catch-all kernel.h header, add missing headers and remove

Seems some fixups in wrong patch as tmp117 stuff in here.

Sashiko shouted about that.

> unused headers.
> 
> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
>
> diff --git a/drivers/iio/temperature/tmp117.c b/drivers/iio/temperature/tmp117.c
> index 25bc98e64e48..96252627613f 100644
> --- a/drivers/iio/temperature/tmp117.c
> +++ b/drivers/iio/temperature/tmp117.c
> @@ -12,13 +12,12 @@
>  #include <linux/array_size.h>
>  #include <linux/bitops.h>
>  #include <linux/delay.h>
> -#include <linux/dev_printk.h>
> +#include <linux/device.h>
>  #include <linux/err.h>
>  #include <linux/i2c.h>
>  #include <linux/limits.h>
>  #include <linux/minmax.h>
>  #include <linux/module.h>
> -#include <linux/property.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/types.h>
>  
> diff --git a/drivers/iio/temperature/tsys01.c b/drivers/iio/temperature/tsys01.c
> index 14de67ee8be7..3c1f5b6ac156 100644
> --- a/drivers/iio/temperature/tsys01.c
> +++ b/drivers/iio/temperature/tsys01.c
> @@ -8,12 +8,14 @@
>   *  http://www.meas-spec.com/downloads/TSYS01_Digital_Temperature_Sensor.pdf
>   */
>  
> -#include <linux/device.h>

 | sashiko.dev <sashiko@sashiko.dev>:
 |
 | [Severity: Low]
 | Does removing <linux/device.h> contradict the Include What You Use principles
 | mentioned in the commit message?
 |
 | Looking at tsys01_probe(), it directly dereferences struct device and struct
 | device_driver:
 |
 | tsys01_probe() {
 |     ...
 |     indio_dev->name = dev->driver->name;

Looks valid to me.

 |     ...
 | }

Jonathan

-- 
Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>

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

* Re: [PATCH v2 09/11] iio: temperature: tsys01: make headers conform to IWYU
  2026-08-29 17:57   ` Jonathan Cameron
@ 2026-08-29 18:09     ` Joshua Crofts
  0 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-29 18:09 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, Crt Mori,
	Puranjay Mohan, linux-iio, linux-kernel

On Sat, 29 Aug 2026 18:57:39 +0100
Jonathan Cameron <jic23@kernel.org> wrote:

> > Remove the catch-all kernel.h header, add missing headers and remove  
> 
> Seems some fixups in wrong patch as tmp117 stuff in here.
> 
> Sashiko shouted about that.

Yeah, must've been half asleep when I was squashing commits.

> 
> > unused headers.
> > 
> > Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
> >
> > diff --git a/drivers/iio/temperature/tmp117.c b/drivers/iio/temperature/tmp117.c
> > index 25bc98e64e48..96252627613f 100644
> > --- a/drivers/iio/temperature/tmp117.c
> > +++ b/drivers/iio/temperature/tmp117.c
> > @@ -12,13 +12,12 @@
> >  #include <linux/array_size.h>
> >  #include <linux/bitops.h>
> >  #include <linux/delay.h>
> > -#include <linux/dev_printk.h>
> > +#include <linux/device.h>
> >  #include <linux/err.h>
> >  #include <linux/i2c.h>
> >  #include <linux/limits.h>
> >  #include <linux/minmax.h>
> >  #include <linux/module.h>
> > -#include <linux/property.h>
> >  #include <linux/regulator/consumer.h>
> >  #include <linux/types.h>
> >  
> > diff --git a/drivers/iio/temperature/tsys01.c b/drivers/iio/temperature/tsys01.c
> > index 14de67ee8be7..3c1f5b6ac156 100644
> > --- a/drivers/iio/temperature/tsys01.c
> > +++ b/drivers/iio/temperature/tsys01.c
> > @@ -8,12 +8,14 @@
> >   *  http://www.meas-spec.com/downloads/TSYS01_Digital_Temperature_Sensor.pdf
> >   */
> >  
> > -#include <linux/device.h>  
> 
>  | sashiko.dev <sashiko@sashiko.dev>:
>  |
>  | [Severity: Low]
>  | Does removing <linux/device.h> contradict the Include What You Use principles
>  | mentioned in the commit message?
>  |
>  | Looking at tsys01_probe(), it directly dereferences struct device and struct
>  | device_driver:
>  |
>  | tsys01_probe() {
>  |     ...
>  |     indio_dev->name = dev->driver->name;
> 
> Looks valid to me.
> 
>  |     ...
>  | }
> 
> Jonathan
> 

Yep, all Sashiko issues addressed in my series locally, but I'll let this
sit for a while before resending.

-- 
Kind regards,
Joshua Crofts

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

* [PATCH v2 00/11] iio: temperature: make headers conform to IWYU
@ 2026-08-31 21:13 Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 01/11] iio: temperature: iqs620at-temp: " Joshua Crofts
                   ` (11 more replies)
  0 siblings, 12 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-31 21:13 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

This series removes any instances of kernel.h in the temperature/
subdirectory and cleans up the headers in order to improve readability
and enforce IYWU instead of relying on transitive dependencies during
the build process.

I had Gemini generate a summary (a bit more verbose) of changed headers
under the --- in each IWYU patch to improve the review process.

This is part of an ongoing effort to remove kernel.h entirely from IIO.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
Changes in v2:
- Add missing headers pointed out by Sashiko.
- Swap <asm/div64.h> for <linux/math64.h> (Jonathan, Andy).
- Squash small reordering patches with iwyu changes.
- Link to v1: https://lore.kernel.org/r/20260822-kernel-header-removal-v1-0-ee31b124be11@gmail.com

---
Joshua Crofts (11):
      iio: temperature: iqs620at-temp: make headers conform to IWYU
      iio: temperature: ltc2983: reorder headers
      iio: temperature: ltc2983: make headers conform to IWYU
      iio: temperature: mlx90632: make headers conform to IWYU
      iio: temperature: mlx90635: make headers conform to IWYU
      iio: temperature: tmp117: sort headers alphabetically
      iio: temperature: tmp117: make headers conform to IWYU
      iio: temperature: tsys01: reorder headers
      iio: temperature: tsys01: make headers conform to IWYU
      iio: temperature: tsys02d: reorder headers
      iio: temperature: tsys02d: make headers conform to IWYU

 drivers/iio/temperature/iqs620at-temp.c |  9 +++++++--
 drivers/iio/temperature/ltc2983.c       | 19 +++++++++++++++----
 drivers/iio/temperature/mlx90632.c      | 10 +++++++---
 drivers/iio/temperature/mlx90635.c      | 11 +++++++----
 drivers/iio/temperature/tmp117.c        |  9 +++++----
 drivers/iio/temperature/tsys01.c        | 17 +++++++++++------
 drivers/iio/temperature/tsys02d.c       | 12 +++++++++---
 7 files changed, 61 insertions(+), 26 deletions(-)
---
base-commit: 350d1fb9204b13c5f95e511e98b8bcb47574d425
change-id: 20260821-kernel-header-removal-d95efd197d78

Best regards,
-- 
Kind regards,
Joshua Crofts


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

* [PATCH v2 01/11] iio: temperature: iqs620at-temp: make headers conform to IWYU
  2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
@ 2026-08-31 21:13 ` Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 02/11] iio: temperature: ltc2983: reorder headers Joshua Crofts
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-31 21:13 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

Remove the catch-all kernel.h header and add the missing headers to
enforce IWYU.

Additionally, separate the IIO specific header from the generic
<linux/*> headers.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
Header changes explained:
Added:
- <asm/byteorder.h>: for endianness helpers
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/bits.h>: for GENMASK() and BIT() macros
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.)
Removed:
- <linux/kernel.h>: catch-all header no longer needed
---
 drivers/iio/temperature/iqs620at-temp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/temperature/iqs620at-temp.c b/drivers/iio/temperature/iqs620at-temp.c
index e2f878d57af7..3a3b1f256585 100644
--- a/drivers/iio/temperature/iqs620at-temp.c
+++ b/drivers/iio/temperature/iqs620at-temp.c
@@ -5,13 +5,18 @@
  * Copyright (C) 2019 Jeff LaBundy <jeff@labundy.com>
  */
 
+#include <linux/array_size.h>
+#include <linux/bits.h>
 #include <linux/device.h>
-#include <linux/iio/iio.h>
-#include <linux/kernel.h>
 #include <linux/mfd/iqs62x.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
+#include <linux/types.h>
+
+#include <asm/byteorder.h>
+
+#include <linux/iio/iio.h>
 
 #define IQS620_TEMP_UI_OUT			0x1A
 

-- 
2.55.0


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

* [PATCH v2 02/11] iio: temperature: ltc2983: reorder headers
  2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 01/11] iio: temperature: iqs620at-temp: " Joshua Crofts
@ 2026-08-31 21:13 ` Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 03/11] iio: temperature: ltc2983: make headers conform to IWYU Joshua Crofts
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-31 21:13 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

Separate the IIO specific header and group unaligned.h with the other
generic <linux/*> headers.

No functional change.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
 drivers/iio/temperature/ltc2983.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c
index 6efb5252a773..fe9eec3058d4 100644
--- a/drivers/iio/temperature/ltc2983.c
+++ b/drivers/iio/temperature/ltc2983.c
@@ -11,7 +11,6 @@
 #include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
-#include <linux/iio/iio.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>
 #include <linux/module.h>
@@ -19,9 +18,11 @@
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
+#include <linux/unaligned.h>
 
 #include <asm/byteorder.h>
-#include <linux/unaligned.h>
+
+#include <linux/iio/iio.h>
 
 /* register map */
 #define LTC2983_STATUS_REG			0x0000

-- 
2.55.0


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

* [PATCH v2 03/11] iio: temperature: ltc2983: make headers conform to IWYU
  2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 01/11] iio: temperature: iqs620at-temp: " Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 02/11] iio: temperature: ltc2983: reorder headers Joshua Crofts
@ 2026-08-31 21:13 ` Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 04/11] iio: temperature: mlx90632: " Joshua Crofts
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-31 21:13 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

Remove the catch-all kernel.h header and add the missing headers to
enforce IWYU (some standard headers are already include subheaders,
i.e. errno.h is included by err.h).

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
Header changes explained:
Added:
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/bitops.h>: for bitwise operations
- <linux/container_of.h>: for container_of macro
- <linux/delay.h>: for usleep_range()
- <linux/gpio/consumer.h>: for GPIO functions
- <linux/math64.h>: for div64 functions
- <linux/mutex.h>: for struct mutex and mutex_lock/unlock
- <linux/pm_runtime.h>: for DEFINE_SIMPLE_DEV_PM_OPS
- <linux/slab.h>: for memory allocation
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.)
Removed:
- <linux/errno.h>: not directly used in this driver
- <linux/kernel.h>: catch-all header no longer needed
---
 drivers/iio/temperature/ltc2983.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c
index fe9eec3058d4..6655453c9abf 100644
--- a/drivers/iio/temperature/ltc2983.c
+++ b/drivers/iio/temperature/ltc2983.c
@@ -5,19 +5,29 @@
  *
  * Copyright 2019 Analog Devices Inc.
  */
+
+#include <linux/array_size.h>
 #include <linux/bitfield.h>
+#include <linux/bitops.h>
 #include <linux/completion.h>
+#include <linux/container_of.h>
+#include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/err.h>
-#include <linux/errno.h>
-#include <linux/kernel.h>
+#include <linux/gpio/consumer.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>
+#include <linux/math64.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/pm_runtime.h>
 #include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
+#include <linux/slab.h>
 #include <linux/spi/spi.h>
+#include <linux/string.h>
+#include <linux/types.h>
 #include <linux/unaligned.h>
 
 #include <asm/byteorder.h>

-- 
2.55.0


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

* [PATCH v2 04/11] iio: temperature: mlx90632: make headers conform to IWYU
  2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
                   ` (2 preceding siblings ...)
  2026-08-31 21:13 ` [PATCH v2 03/11] iio: temperature: ltc2983: make headers conform to IWYU Joshua Crofts
@ 2026-08-31 21:13 ` Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 05/11] iio: temperature: mlx90635: " Joshua Crofts
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-31 21:13 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

Remove the catch-all kernel.h header and add the missing headers to
enforce IWYU.

Additionally, sort the entries alphabetically.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
Header changes explained:
Added:
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/bits.h>: for GENMASK() and BIT() macros
- <linux/dev_printk.h>: for dev_err(), dev_info(), etc.
- <linux/mutex.h>: for struct mutex and mutex_lock/unlock
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.)
Removed:
- <linux/gpio/consumer.h>: not directly used in this driver
- <linux/kernel.h>: catch-all header no longer needed
---
 drivers/iio/temperature/mlx90632.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c
index 2fde48f337e2..74ae36f74e8b 100644
--- a/drivers/iio/temperature/mlx90632.c
+++ b/drivers/iio/temperature/mlx90632.c
@@ -6,21 +6,25 @@
  *
  * Driver for the Melexis MLX90632 I2C 16-bit IR thermopile sensor
  */
+
+#include <linux/array_size.h>
 #include <linux/bitfield.h>
+#include <linux/bits.h>
 #include <linux/delay.h>
+#include <linux/dev_printk.h>
 #include <linux/device.h>
 #include <linux/err.h>
-#include <linux/gpio/consumer.h>
 #include <linux/i2c.h>
 #include <linux/iopoll.h>
 #include <linux/jiffies.h>
-#include <linux/kernel.h>
 #include <linux/limits.h>
-#include <linux/module.h>
 #include <linux/math64.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
+#include <linux/types.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>

-- 
2.55.0


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

* [PATCH v2 05/11] iio: temperature: mlx90635: make headers conform to IWYU
  2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
                   ` (3 preceding siblings ...)
  2026-08-31 21:13 ` [PATCH v2 04/11] iio: temperature: mlx90632: " Joshua Crofts
@ 2026-08-31 21:13 ` Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 06/11] iio: temperature: tmp117: sort headers alphabetically Joshua Crofts
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-31 21:13 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

Remove the catch-all kernel.h header and add the missing headers to
enforce IWYU.

Additionally, sort the headers alphabetically.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
Header changes explained:
Added:
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/bits.h>: for GENMASK() and BIT() macros
- <linux/dev_printk.h>: for dev_err(), dev_info(), etc.
- <linux/mutex.h>: for struct mutex and mutex_lock/unlock
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.)
Removed:
- <linux/gpio/consumer.h>: not directly used in this driver
- <linux/kernel.h>: catch-all header no longer needed
- <linux/limits.h>: not directly used in this driver
---
 drivers/iio/temperature/mlx90635.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/temperature/mlx90635.c b/drivers/iio/temperature/mlx90635.c
index 0f31879a4f64..48c760c980f3 100644
--- a/drivers/iio/temperature/mlx90635.c
+++ b/drivers/iio/temperature/mlx90635.c
@@ -6,21 +6,24 @@
  *
  * Driver for the Melexis MLX90635 I2C 16-bit IR thermopile sensor
  */
+
+#include <linux/array_size.h>
 #include <linux/bitfield.h>
+#include <linux/bits.h>
 #include <linux/delay.h>
+#include <linux/dev_printk.h>
 #include <linux/device.h>
 #include <linux/err.h>
-#include <linux/gpio/consumer.h>
 #include <linux/i2c.h>
 #include <linux/iopoll.h>
 #include <linux/jiffies.h>
-#include <linux/kernel.h>
-#include <linux/limits.h>
-#include <linux/module.h>
 #include <linux/math64.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
+#include <linux/types.h>
 
 #include <linux/iio/iio.h>
 

-- 
2.55.0


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

* [PATCH v2 06/11] iio: temperature: tmp117: sort headers alphabetically
  2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
                   ` (4 preceding siblings ...)
  2026-08-31 21:13 ` [PATCH v2 05/11] iio: temperature: mlx90635: " Joshua Crofts
@ 2026-08-31 21:13 ` Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 07/11] iio: temperature: tmp117: make headers conform to IWYU Joshua Crofts
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-31 21:13 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

Sort the headers alphabetically to improve readability.

No functional change.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
 drivers/iio/temperature/tmp117.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/temperature/tmp117.c b/drivers/iio/temperature/tmp117.c
index 74cb8d62bef3..fed8af2d81eb 100644
--- a/drivers/iio/temperature/tmp117.c
+++ b/drivers/iio/temperature/tmp117.c
@@ -10,16 +10,16 @@
  */
 
 #include <linux/array_size.h>
+#include <linux/bitops.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/i2c.h>
-#include <linux/module.h>
-#include <linux/bitops.h>
-#include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/limits.h>
+#include <linux/module.h>
 #include <linux/property.h>
 #include <linux/regulator/consumer.h>
+#include <linux/types.h>
 
 #include <linux/iio/iio.h>
 

-- 
2.55.0


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

* [PATCH v2 07/11] iio: temperature: tmp117: make headers conform to IWYU
  2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
                   ` (5 preceding siblings ...)
  2026-08-31 21:13 ` [PATCH v2 06/11] iio: temperature: tmp117: sort headers alphabetically Joshua Crofts
@ 2026-08-31 21:13 ` Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 08/11] iio: temperature: tsys01: reorder headers Joshua Crofts
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-31 21:13 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

Remove the catch-all kernel.h header and add the missing
<linux/dev_printk.h> header to enforce IWYU.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
Header changes explained:
Added:
- <linux/dev_printk.h>: for dev_err(), dev_info(), etc.
- <linux/minmax.h>: for min/max limit macros
Removed:
- <linux/kernel.h>: catch-all header no longer needed
---
 drivers/iio/temperature/tmp117.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/temperature/tmp117.c b/drivers/iio/temperature/tmp117.c
index fed8af2d81eb..25bc98e64e48 100644
--- a/drivers/iio/temperature/tmp117.c
+++ b/drivers/iio/temperature/tmp117.c
@@ -12,10 +12,11 @@
 #include <linux/array_size.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
+#include <linux/dev_printk.h>
 #include <linux/err.h>
 #include <linux/i2c.h>
-#include <linux/kernel.h>
 #include <linux/limits.h>
+#include <linux/minmax.h>
 #include <linux/module.h>
 #include <linux/property.h>
 #include <linux/regulator/consumer.h>

-- 
2.55.0


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

* [PATCH v2 08/11] iio: temperature: tsys01: reorder headers
  2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
                   ` (6 preceding siblings ...)
  2026-08-31 21:13 ` [PATCH v2 07/11] iio: temperature: tmp117: make headers conform to IWYU Joshua Crofts
@ 2026-08-31 21:13 ` Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 09/11] iio: temperature: tsys01: make headers conform to IWYU Joshua Crofts
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-31 21:13 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

Sort the headers alphabetically and group the IIO headers and vendor
specific header separately.

No functional change.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
 drivers/iio/temperature/tsys01.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/temperature/tsys01.c b/drivers/iio/temperature/tsys01.c
index 28b3ce022ce7..14de67ee8be7 100644
--- a/drivers/iio/temperature/tsys01.c
+++ b/drivers/iio/temperature/tsys01.c
@@ -8,14 +8,16 @@
  *  http://www.meas-spec.com/downloads/TSYS01_Digital_Temperature_Sensor.pdf
  */
 
-#include <linux/iio/iio.h>
-#include <linux/iio/sysfs.h>
 #include <linux/device.h>
-#include <linux/mutex.h>
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/stat.h>
+
+#include <linux/iio/iio.h>
+#include <linux/iio/sysfs.h>
+
 #include "../common/ms_sensors/ms_sensors_i2c.h"
 
 /* TSYS01 Commands */

-- 
2.55.0


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

* [PATCH v2 09/11] iio: temperature: tsys01: make headers conform to IWYU
  2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
                   ` (7 preceding siblings ...)
  2026-08-31 21:13 ` [PATCH v2 08/11] iio: temperature: tsys01: reorder headers Joshua Crofts
@ 2026-08-31 21:13 ` Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 10/11] iio: temperature: tsys02d: reorder headers Joshua Crofts
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-31 21:13 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

Remove the catch-all kernel.h header, add missing headers and remove
unused headers.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
Header changes explained:
Added:
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/bits.h>: for BIT()
- <linux/device.h>: for struct device
- <linux/i2c.h>: for i2c_client and i2c_device_id
- <linux/math64.h>: for div64 functions
- <linux/sprintf.h>: for sprintf functions
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.)
Removed:
- <linux/init.h>: not directly used in this driver
- <linux/kernel.h>: catch-all header no longer needed
- <linux/property.h>: not directly used in this driver
- <linux/stat.h>: not directly used in this driver
---
 drivers/iio/temperature/tsys01.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/temperature/tsys01.c b/drivers/iio/temperature/tsys01.c
index 14de67ee8be7..b19b4a3ef038 100644
--- a/drivers/iio/temperature/tsys01.c
+++ b/drivers/iio/temperature/tsys01.c
@@ -8,12 +8,15 @@
  *  http://www.meas-spec.com/downloads/TSYS01_Digital_Temperature_Sensor.pdf
  */
 
+#include <linux/array_size.h>
+#include <linux/bits.h>
 #include <linux/device.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
+#include <linux/i2c.h>
+#include <linux/math64.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
-#include <linux/stat.h>
+#include <linux/sprintf.h>
+#include <linux/types.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>

-- 
2.55.0


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

* [PATCH v2 10/11] iio: temperature: tsys02d: reorder headers
  2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
                   ` (8 preceding siblings ...)
  2026-08-31 21:13 ` [PATCH v2 09/11] iio: temperature: tsys01: make headers conform to IWYU Joshua Crofts
@ 2026-08-31 21:13 ` Joshua Crofts
  2026-08-31 21:13 ` [PATCH v2 11/11] iio: temperature: tsys02d: make headers conform to IWYU Joshua Crofts
  2026-09-01  5:09 ` [PATCH v2 00/11] iio: temperature: " Joshua Crofts
  11 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-31 21:13 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

Sort the headers alphabetically and group the IIO specific headers
separately.

No functional change.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
 drivers/iio/temperature/tsys02d.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/temperature/tsys02d.c b/drivers/iio/temperature/tsys02d.c
index 3ef72347456e..377e27b45fdd 100644
--- a/drivers/iio/temperature/tsys02d.c
+++ b/drivers/iio/temperature/tsys02d.c
@@ -10,11 +10,12 @@
  *  http://www.meas-spec.com/downloads/Digital_Sensor_TSYS02D.pdf
  */
 
-#include <linux/init.h>
 #include <linux/device.h>
+#include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/stat.h>
 #include <linux/module.h>
+#include <linux/stat.h>
+
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 

-- 
2.55.0


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

* [PATCH v2 11/11] iio: temperature: tsys02d: make headers conform to IWYU
  2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
                   ` (9 preceding siblings ...)
  2026-08-31 21:13 ` [PATCH v2 10/11] iio: temperature: tsys02d: reorder headers Joshua Crofts
@ 2026-08-31 21:13 ` Joshua Crofts
  2026-09-01  5:09 ` [PATCH v2 00/11] iio: temperature: " Joshua Crofts
  11 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-08-31 21:13 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel, Joshua Crofts

Remove the catch-all kernel.h header, add missing headers and remove
unused headers.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
Header changes explained:
Added:
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/bits.h>: for GENMASK() and BIT() macros
- <linux/i2c.h>: for i2c_client and i2c_device_id
- <linux/mutex.h>: for struct mutex and mutex_lock/unlock
- <linux/sysfs.h>: for sysfs API
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.)
Removed:
- <linux/init.h>: not directly used in this driver
- <linux/kernel.h>: catch-all header no longer needed
---
 drivers/iio/temperature/tsys02d.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/temperature/tsys02d.c b/drivers/iio/temperature/tsys02d.c
index 377e27b45fdd..2c67faebd90c 100644
--- a/drivers/iio/temperature/tsys02d.c
+++ b/drivers/iio/temperature/tsys02d.c
@@ -10,11 +10,16 @@
  *  http://www.meas-spec.com/downloads/Digital_Sensor_TSYS02D.pdf
  */
 
+#include <linux/array_size.h>
+#include <linux/bits.h>
+#include <linux/dev_printk.h>
 #include <linux/device.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
+#include <linux/i2c.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/stat.h>
+#include <linux/sysfs.h>
+#include <linux/types.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>

-- 
2.55.0


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

* Re: [PATCH v2 00/11] iio: temperature: make headers conform to IWYU
  2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
                   ` (10 preceding siblings ...)
  2026-08-31 21:13 ` [PATCH v2 11/11] iio: temperature: tsys02d: make headers conform to IWYU Joshua Crofts
@ 2026-09-01  5:09 ` Joshua Crofts
  2026-09-01  7:55   ` Joshua Crofts
  11 siblings, 1 reply; 17+ messages in thread
From: Joshua Crofts @ 2026-09-01  5:09 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel

On Mon, 31 Aug 2026 at 23:13, Joshua Crofts <joshua.crofts1@gmail.com> wrote:
>
> This series removes any instances of kernel.h in the temperature/
> subdirectory and cleans up the headers in order to improve readability
> and enforce IYWU instead of relying on transitive dependencies during
> the build process.
>
> I had Gemini generate a summary (a bit more verbose) of changed headers
> under the --- in each IWYU patch to improve the review process.
>
> This is part of an ongoing effort to remove kernel.h entirely from IIO.
>
> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
> ---
> Changes in v2:
> - Add missing headers pointed out by Sashiko.
> - Swap <asm/div64.h> for <linux/math64.h> (Jonathan, Andy).
> - Squash small reordering patches with iwyu changes.
> - Link to v1: https://lore.kernel.org/r/20260822-kernel-header-removal-v1-0-ee31b124be11@gmail.com
>
> ---
> Joshua Crofts (11):
>       iio: temperature: iqs620at-temp: make headers conform to IWYU
>       iio: temperature: ltc2983: reorder headers
>       iio: temperature: ltc2983: make headers conform to IWYU
>       iio: temperature: mlx90632: make headers conform to IWYU
>       iio: temperature: mlx90635: make headers conform to IWYU
>       iio: temperature: tmp117: sort headers alphabetically
>       iio: temperature: tmp117: make headers conform to IWYU
>       iio: temperature: tsys01: reorder headers
>       iio: temperature: tsys01: make headers conform to IWYU
>       iio: temperature: tsys02d: reorder headers
>       iio: temperature: tsys02d: make headers conform to IWYU
>
>  drivers/iio/temperature/iqs620at-temp.c |  9 +++++++--
>  drivers/iio/temperature/ltc2983.c       | 19 +++++++++++++++----
>  drivers/iio/temperature/mlx90632.c      | 10 +++++++---
>  drivers/iio/temperature/mlx90635.c      | 11 +++++++----
>  drivers/iio/temperature/tmp117.c        |  9 +++++----
>  drivers/iio/temperature/tsys01.c        | 17 +++++++++++------
>  drivers/iio/temperature/tsys02d.c       | 12 +++++++++---
>  7 files changed, 61 insertions(+), 26 deletions(-)
> ---

I seem to be having b4 issues as this sent v2 again with the same
mistakes?

-- 
Kind regards

CJD

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

* Re: [PATCH v2 00/11] iio: temperature: make headers conform to IWYU
  2026-09-01  5:09 ` [PATCH v2 00/11] iio: temperature: " Joshua Crofts
@ 2026-09-01  7:55   ` Joshua Crofts
  0 siblings, 0 replies; 17+ messages in thread
From: Joshua Crofts @ 2026-09-01  7:55 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Crt Mori, Puranjay Mohan
  Cc: linux-iio, linux-kernel

On Tue, 1 Sept 2026 at 07:09, Joshua Crofts <joshua.crofts1@gmail.com> wrote:
> > Changes in v2:
> > - Add missing headers pointed out by Sashiko.
> > - Swap <asm/div64.h> for <linux/math64.h> (Jonathan, Andy).
> > - Squash small reordering patches with iwyu changes.
> > - Link to v1: https://lore.kernel.org/r/20260822-kernel-header-removal-v1-0-ee31b124be11@gmail.com
> >
> > ---
> > Joshua Crofts (11):
> >       iio: temperature: iqs620at-temp: make headers conform to IWYU
> >       iio: temperature: ltc2983: reorder headers
> >       iio: temperature: ltc2983: make headers conform to IWYU
> >       iio: temperature: mlx90632: make headers conform to IWYU
> >       iio: temperature: mlx90635: make headers conform to IWYU
> >       iio: temperature: tmp117: sort headers alphabetically
> >       iio: temperature: tmp117: make headers conform to IWYU
> >       iio: temperature: tsys01: reorder headers
> >       iio: temperature: tsys01: make headers conform to IWYU
> >       iio: temperature: tsys02d: reorder headers
> >       iio: temperature: tsys02d: make headers conform to IWYU
> >
> >  drivers/iio/temperature/iqs620at-temp.c |  9 +++++++--
> >  drivers/iio/temperature/ltc2983.c       | 19 +++++++++++++++----
> >  drivers/iio/temperature/mlx90632.c      | 10 +++++++---
> >  drivers/iio/temperature/mlx90635.c      | 11 +++++++----
> >  drivers/iio/temperature/tmp117.c        |  9 +++++----
> >  drivers/iio/temperature/tsys01.c        | 17 +++++++++++------
> >  drivers/iio/temperature/tsys02d.c       | 12 +++++++++---
> >  7 files changed, 61 insertions(+), 26 deletions(-)
> > ---
>
> I seem to be having b4 issues as this sent v2 again with the same
> mistakes?

Okay, never mind. b4 did send the right series but forgot to bump the version
number up.

Anyway, some Sashiko remarks - just commit message issues (forgot to update
some headers under the ---) + one remark about me including slab.h for
GFP_KERNEL, but I suppose I could change this to gfp_types.h instead.

-- 
Kind regards,
Joshua Crofts

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

end of thread, other threads:[~2026-09-01  7:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 21:13 [PATCH v2 00/11] iio: temperature: make headers conform to IWYU Joshua Crofts
2026-08-31 21:13 ` [PATCH v2 01/11] iio: temperature: iqs620at-temp: " Joshua Crofts
2026-08-31 21:13 ` [PATCH v2 02/11] iio: temperature: ltc2983: reorder headers Joshua Crofts
2026-08-31 21:13 ` [PATCH v2 03/11] iio: temperature: ltc2983: make headers conform to IWYU Joshua Crofts
2026-08-31 21:13 ` [PATCH v2 04/11] iio: temperature: mlx90632: " Joshua Crofts
2026-08-31 21:13 ` [PATCH v2 05/11] iio: temperature: mlx90635: " Joshua Crofts
2026-08-31 21:13 ` [PATCH v2 06/11] iio: temperature: tmp117: sort headers alphabetically Joshua Crofts
2026-08-31 21:13 ` [PATCH v2 07/11] iio: temperature: tmp117: make headers conform to IWYU Joshua Crofts
2026-08-31 21:13 ` [PATCH v2 08/11] iio: temperature: tsys01: reorder headers Joshua Crofts
2026-08-31 21:13 ` [PATCH v2 09/11] iio: temperature: tsys01: make headers conform to IWYU Joshua Crofts
2026-08-31 21:13 ` [PATCH v2 10/11] iio: temperature: tsys02d: reorder headers Joshua Crofts
2026-08-31 21:13 ` [PATCH v2 11/11] iio: temperature: tsys02d: make headers conform to IWYU Joshua Crofts
2026-09-01  5:09 ` [PATCH v2 00/11] iio: temperature: " Joshua Crofts
2026-09-01  7:55   ` Joshua Crofts
  -- strict thread matches above, loose matches on Subject: below --
2026-08-29 16:25 Joshua Crofts
2026-08-29 16:26 ` [PATCH v2 09/11] iio: temperature: tsys01: " Joshua Crofts
2026-08-29 17:57   ` Jonathan Cameron
2026-08-29 18:09     ` Joshua Crofts

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