iio: gyro: header cleanups
Subsystems (3)
cover iio: gyro: header cleanups
Remove any kernel.h occurences in gyro/ and update the headers in accordance with IWYU (at least loosely).
---
Joshua Crofts (9):
iio: gyro: adis16080: reorder headers
iio: gyro: adis16080: apply iwyu principle
iio: gyro: adis16136: apply iwyu principle
iio: gyro: adis16130: apply iwyu principle
iio: gyro: adis16260: apply iwyu principle
iio: gyro: adxrs290: apply iwyu principle
iio: gyro: adxrs450: sort headers
iio: gyro: adxrs450: apply iwyu principle
iio: gyro: st_gyro: apply iwyu principle
drivers/iio/gyro/adis16080.c | 15 +++++++++++---- drivers/iio/gyro/adis16130.c | 10 ++++++---- drivers/iio/gyro/adis16136.c | 10 +++++++--- drivers/iio/gyro/adis16260.c | 9 ++++++--- drivers/iio/gyro/adxrs290.c | 5 ++++- drivers/iio/gyro/adxrs450.c | 17 +++++++++++------ drivers/iio/gyro/st_gyro_buffer.c | 1 - drivers/iio/gyro/st_gyro_core.c | 7 +++++-- drivers/iio/gyro/st_gyro_i2c.c | 6 ++++-- drivers/iio/gyro/st_gyro_spi.c | 4 +++- 10 files changed, 57 insertions(+), 27 deletions(-)
---
base-commit: 903941a9b06ae445c70646ab061b604c2dea17d3
change-id: 20261120-gyro-kernel-header-removal-7e7ce8b60656
Best regards,
Signature · 1 line
Joshua Crofts
PATCH 1/9 iio: gyro: adis16080: reorder headers
Sort the headers alphabetically for better readability.
--- drivers/iio/gyro/adis16080.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/gyro/adis16080.c +3 -3
@@ -5,13 +5,13 @@* Copyright 2010 Analog Devices Inc. */ #include <linux/delay.h> -#include <linux/mutex.h> #include <linux/device.h> #include <linux/kernel.h> -#include <linux/spi/spi.h> +#include <linux/module.h> +#include <linux/mutex.h> #include <linux/slab.h> +#include <linux/spi/spi.h> #include <linux/sysfs.h> -#include <linux/module.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h>
Signature · 1 line
2.56.0
PATCH 2/9 iio: gyro: adis16080: apply iwyu principle
In reply to Joshua CroftsRemove the catch all kernel.h header and add/remove the remaining headers in accordance with the IWYU principle.
--- drivers/iio/gyro/adis16080.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/iio/gyro/adis16080.c +8 -1
@@ -4,14 +4,21 @@* * Copyright 2010 Analog Devices Inc. */ + +#include <linux/array_size.h> +#include <linux/bitops.h> #include <linux/delay.h> #include <linux/device.h> -#include <linux/kernel.h> +#include <linux/errno.h> +#include <linux/math.h> #include <linux/module.h> #include <linux/mutex.h> #include <linux/slab.h> #include <linux/spi/spi.h> #include <linux/sysfs.h> +#include <linux/types.h> + +#include <asm/byteorder.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h>
Signature · 1 line
2.56.0
PATCH 3/9 iio: gyro: adis16136: apply iwyu principle
In reply to Joshua CroftsRemove the catch all kernel.h header and add/remove the remaining headers in accordance with the IWYU principle.
--- drivers/iio/gyro/adis16136.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/iio/gyro/adis16136.c +7 -3
@@ -6,17 +6,21 @@* Author: Lars-Peter Clausen <[email protected]> */ +#include <linux/array_size.h> +#include <linux/bits.h> +#include <linux/debugfs.h> #include <linux/device.h> -#include <linux/kernel.h> +#include <linux/kstrtox.h> +#include <linux/module.h> #include <linux/spi/spi.h> +#include <linux/sprintf.h> #include <linux/sysfs.h> -#include <linux/module.h> +#include <linux/types.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> #include <linux/iio/imu/adis.h> -#include <linux/debugfs.h> #define ADIS16136_REG_FLASH_CNT 0x00#define ADIS16136_REG_TEMP_OUT 0x02
Signature · 1 line
2.56.0
PATCH 4/9 iio: gyro: adis16130: apply iwyu principle
In reply to Joshua CroftsRemove the catch all kernel.h header and add/remove the remaining headers in accordance with the IWYU principle.
--- drivers/iio/gyro/adis16130.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/iio/gyro/adis16130.c +6 -4
@@ -5,14 +5,16 @@* Copyright 2010 Analog Devices Inc. */ +#include <linux/array_size.h> +#include <linux/bits.h> +#include <linux/errno.h> +#include <linux/module.h> #include <linux/mutex.h> -#include <linux/kernel.h> #include <linux/spi/spi.h> -#include <linux/module.h> - +#include <linux/unaligned.h> +#include <linux/types.h> #include <linux/iio/iio.h> -#include <linux/unaligned.h> #define ADIS16130_CON 0x0#define ADIS16130_CON_RD (1 << 6)
Signature · 1 line
2.56.0
Re: [PATCH 4/9] iio: gyro: adis16130: apply iwyu principle
Quoted 2 lines · Joshua Crofts
Remove the catch all
kernel.hheader and add/remove the remaining headers in accordance with the IWYU principle.
...
drivers/iio/gyro/adis16130.c
Quoted 5 lines
drivers/iio/gyro/adis16130.c +0
-3-#include <linux/kernel.h> #include <linux/spi/spi.h> -#include <linux/module.h> -
Leave this blank line before iio/ group as it originally was.
Quoted 5 lines
drivers/iio/gyro/adis16130.c +2
-1+#include <linux/unaligned.h> +#include <linux/types.h> #include <linux/iio/iio.h> -#include <linux/unaligned.h>
Signature · 2 lines
With Best Regards, Andy Shevchenko
Jonathan Cameron
maintainerRe: [PATCH 4/9] iio: gyro: adis16130: apply iwyu principle
Quoted 6 lines · On Wed, 25 Nov 2026 23:57:13 +0200 Andy Shevchenko…
Quoted 2 lines · Joshua Crofts
Remove the catch all
kernel.hheader and add/remove the remaining headers in accordance with the IWYU principle....
Quoted 7 lines
drivers/iio/gyro/adis16130.c
Quoted 5 lines
drivers/iio/gyro/adis16130.c +0
-3-#include <linux/kernel.h> #include <linux/spi/spi.h> -#include <linux/module.h> -Leave this blank line before iio/ group as it originally was.
Tweaked and also removed the extra line we end up with at the end as a result of moving unaligned.h
Quoted 7 lines
Quoted 6 lines
drivers/iio/gyro/adis16130.c +2
-1+#include <linux/unaligned.h> +#include <linux/types.h> #include <linux/iio/iio.h> -#include <linux/unaligned.h>
PATCH 5/9 iio: gyro: adis16260: apply iwyu principle
In reply to Joshua CroftsRemove the catch all kernel.h header and add/remove the remaining headers in accordance with the IWYU principle.
--- drivers/iio/gyro/adis16260.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/iio/gyro/adis16260.c +6 -3
@@ -5,10 +5,13 @@* Copyright 2010 Analog Devices Inc. */ -#include <linux/device.h> -#include <linux/kernel.h> -#include <linux/spi/spi.h> +#include <linux/array_size.h> +#include <linux/bits.h> +#include <linux/dev_printk.h> +#include <linux/errno.h> #include <linux/module.h> +#include <linux/spi/spi.h> +#include <linux/types.h> #include <linux/iio/iio.h> #include <linux/iio/imu/adis.h>
Signature · 1 line
2.56.0
PATCH 6/9 iio: gyro: adxrs290: apply iwyu principle
In reply to Joshua CroftsRemove the catch all kernel.h header and add/remove the remaining headers in accordance with the IWYU principle.
--- drivers/iio/gyro/adxrs290.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/iio/gyro/adxrs290.c +4 -1
@@ -6,14 +6,17 @@* Copyright (C) 2020 Analog Devices, Inc. */ +#include <linux/array_size.h> #include <linux/bitfield.h> #include <linux/bitops.h> #include <linux/cleanup.h> #include <linux/delay.h> #include <linux/device.h> -#include <linux/kernel.h> +#include <linux/errno.h> #include <linux/module.h> +#include <linux/mutex.h> #include <linux/spi/spi.h> +#include <linux/types.h> #include <linux/iio/buffer.h> #include <linux/iio/iio.h>
Signature · 1 line
2.56.0
PATCH 7/9 iio: gyro: adxrs450: sort headers
In reply to Joshua CroftsSort headers alphabetically to improve code style.
--- drivers/iio/gyro/adxrs450.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/iio/gyro/adxrs450.c +6 -6
@@ -5,17 +5,17 @@* Copyright 2011 Analog Devices Inc. */ -#include <linux/interrupt.h> -#include <linux/irq.h> #include <linux/delay.h> -#include <linux/mutex.h> #include <linux/device.h> +#include <linux/interrupt.h> +#include <linux/irq.h> #include <linux/kernel.h> -#include <linux/spi/spi.h> -#include <linux/slab.h> -#include <linux/sysfs.h> #include <linux/list.h> #include <linux/module.h> +#include <linux/mutex.h> +#include <linux/slab.h> +#include <linux/spi/spi.h> +#include <linux/sysfs.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h>
Signature · 1 line
2.56.0
PATCH 8/9 iio: gyro: adxrs450: apply iwyu principle
In reply to Joshua CroftsRemove the catch all kernel.h header and add/remove the remaining headers in accordance with the IWYU principle.
--- drivers/iio/gyro/adxrs450.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/gyro/adxrs450.c +6 -1
@@ -5,17 +5,22 @@* Copyright 2011 Analog Devices Inc. */ +#include <linux/array_size.h> +#include <linux/bitops.h> #include <linux/delay.h> #include <linux/device.h> +#include <linux/errno.h> #include <linux/interrupt.h> #include <linux/irq.h> -#include <linux/kernel.h> #include <linux/list.h> #include <linux/module.h> #include <linux/mutex.h> #include <linux/slab.h> #include <linux/spi/spi.h> #include <linux/sysfs.h> +#include <linux/types.h> + +#include <asm/byteorder.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h>
Signature · 1 line
2.56.0
PATCH 9/9 iio: gyro: st_gyro: apply iwyu principle
In reply to Joshua CroftsRemove the catch all kernel.h header and add/remove the remaining headers in accordance with the IWYU principle.
--- drivers/iio/gyro/st_gyro_buffer.c | 1 - drivers/iio/gyro/st_gyro_core.c | 7 +++++-- drivers/iio/gyro/st_gyro_i2c.c | 6 ++++-- drivers/iio/gyro/st_gyro_spi.c | 4 +++- 4 files changed, 12 insertions(+), 6 deletions(-)
drivers/iio/gyro/st_gyro_buffer.c +0 -1
@@ -7,7 +7,6 @@* Denis Ciocca <[email protected]> */ -#include <linux/kernel.h> #include <linux/iio/iio.h> #include <linux/iio/buffer.h> #include <linux/iio/trigger.h>
drivers/iio/gyro/st_gyro_core.c +5 -2
@@ -7,11 +7,14 @@* Denis Ciocca <[email protected]> */ -#include <linux/kernel.h> +#include <linux/array_size.h> +#include <linux/bits.h> +#include <linux/errno.h> +#include <linux/interrupt.h> #include <linux/module.h> #include <linux/mutex.h> -#include <linux/interrupt.h> #include <linux/sysfs.h> +#include <linux/iio/iio.h> #include <linux/iio/sysfs.h> #include <linux/iio/trigger.h>
drivers/iio/gyro/st_gyro_i2c.c +4 -2
@@ -7,9 +7,11 @@* Denis Ciocca <[email protected]> */ -#include <linux/kernel.h> -#include <linux/module.h> +#include <linux/dev_printk.h> +#include <linux/errno.h> #include <linux/i2c.h> +#include <linux/module.h> +#include <linux/iio/iio.h> #include <linux/iio/common/st_sensors.h>
drivers/iio/gyro/st_gyro_spi.c +3 -1
@@ -7,9 +7,11 @@* Denis Ciocca <[email protected]> */ -#include <linux/kernel.h> +#include <linux/dev_printk.h> +#include <linux/errno.h> #include <linux/module.h> #include <linux/spi/spi.h> +#include <linux/iio/iio.h> #include <linux/iio/common/st_sensors.h>
Signature · 1 line
2.56.0
Quoted 2 lines · Joshua Crofts
Remove any
kernel.hoccurences in gyro/ and update the headers in accordance with IWYU (at least loosely).
for the whole series, thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Jonathan Cameron
maintainerQuoted 4 lines · On Wed, 25 Nov 2026 20:24:01 +0100 Joshua Crofts <[email protected]> wrote:
Remove any
kernel.hoccurences in gyro/ and update the headers in accordance with IWYU (at least loosely).Signed-off-by Joshua Crofts <[email protected]>
I suspect we won't get much additional review on this lot and seeing as Andy already took a look, I'll pick them up now.
Applied to the testing branch of iio.git
thanks,
Jonathan
Quoted 28 lines
---
Joshua Crofts (9):
iio: gyro: adis16080: reorder headers
iio: gyro: adis16080: apply iwyu principle
iio: gyro: adis16136: apply iwyu principle
iio: gyro: adis16130: apply iwyu principle
iio: gyro: adis16260: apply iwyu principle
iio: gyro: adxrs290: apply iwyu principle
iio: gyro: adxrs450: sort headers
iio: gyro: adxrs450: apply iwyu principle
iio: gyro:st_gyro: apply iwyu principledrivers/iio/gyro/adis16080.c | 15 +++++++++++---- drivers/iio/gyro/adis16130.c | 10 ++++++---- drivers/iio/gyro/adis16136.c | 10 +++++++--- drivers/iio/gyro/adis16260.c | 9 ++++++--- drivers/iio/gyro/adxrs290.c | 5 ++++- drivers/iio/gyro/adxrs450.c | 17 +++++++++++------ drivers/iio/gyro/st_gyro_buffer.c | 1 - drivers/iio/gyro/st_gyro_core.c | 7 +++++-- drivers/iio/gyro/st_gyro_i2c.c | 6 ++++-- drivers/iio/gyro/st_gyro_spi.c | 4 +++- 10 files changed, 57 insertions(+), 27 deletions(-)---
base-commit:903941a9b06ae445c70646ab061b604c2dea17d3
change-id: 20261120-gyro-kernel-header-removal-7e7ce8b60656Best regards,
Quoted 9 lines · Jonathan Cameron
Quoted 4 lines · On Wed, 25 Nov 2026 20:24:01 +0100 Joshua Crofts <[email protected]> wrote:
Remove any
kernel.hoccurences in gyro/ and update the headers in accordance with IWYU (at least loosely).Signed-off-by Joshua Crofts <[email protected]>I suspect we won't get much additional review on this lot and seeing as Andy already took a look, I'll pick them up now.
Ah, well Sashiko had some remarks to patches 2 and 3. Alright if I send patches for you to fixup the applied ones?
Signature · 2 lines
Kind regards, Joshua Crofts
Jonathan Cameron
maintainerQuoted 7 lines · On Thu, 26 Nov 2026 10:14:54 +0100 Joshua Crofts <[email protected]> wrote:
Quoted 6 lines · Jonathan Cameron
Quoted 3 lines · On Wed, 25 Nov 2026 20:24:01 +0100 Joshua Crofts <[email protected]> wrote:
Remove any
kernel.hoccurences in gyro/ and update the headers in accordance with IWYU (at least loosely).
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Joshua Crofts <[email protected]>I suspect we won't get much additional review on this lot and seeing as Andy already took a look, I'll pick them up now.
Ah, well Sashiko had some remarks to patches 2 and 3. Alright if I send patches for you to fixup the applied ones?
I forgot to check Sashiko
Have dropped those two patches. Send a v2 of them.
Thanks,
Jonathan