Skip to contentSkip to conversation

iio: gyro: header cleanups

PATCH In review Joshua Crofts 2 participants 5 messages Nov 29 – Nov 30

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover iio: gyro: header cleanups

Remove any kernel.h occurences in gyro/ and update the headers in accordance with IWYU (at least loosely).

---
Changes in v2:
- Address Sashiko review: a few missing and unused includes.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Joshua Crofts (2):
iio: gyro: adis16080: apply iwyu principle
iio: gyro: adis16136: apply iwyu principle

 drivers/iio/gyro/adis16080.c | 13 ++++++++-----
 drivers/iio/gyro/adis16136.c | 12 +++++++++---
 2 files changed, 17 insertions(+), 8 deletions(-)

---
base-commit: a6d01d696125566b722cde7293fb1735b7866be1
change-id: 20261120-gyro-kernel-header-removal-7e7ce8b60656

Best regards,

Signature · 1 line
Joshua Crofts
#1 lore raw

PATCH v2 1/2 iio: gyro: adis16080: apply iwyu principle

Remove the catch all kernel.h header and add/remove the remaining headers in accordance with the IWYU principle.

---
 drivers/iio/gyro/adis16080.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/iio/gyro/adis16080.c +8 -5
index 27e6f28c69d5..cb75a5b6d342 100644
@@ -4,17 +4,20 @@
  *
  * Copyright 2010 Analog Devices Inc.
  */
-#include <linux/delay.h>
+
+#include <linux/array_size.h>
+#include <linux/bitops.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>
 
 #define ADIS16080_DIN_GYRO   (0 << 10) /* Gyroscope output */
 #define ADIS16080_DIN_TEMP   (1 << 10) /* Temperature output */
Signature · 1 line
2.56.0
#2 lore raw

PATCH v2 2/2 iio: gyro: adis16136: apply iwyu principle

In reply to Joshua Crofts

Remove the catch all kernel.h header and add/remove the remaining headers in accordance with the IWYU principle.

---
 drivers/iio/gyro/adis16136.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/iio/gyro/adis16136.c +9 -3
index b687588ada03..8312217859d0 100644
@@ -6,17 +6,23 @@
  *   Author: Lars-Peter Clausen <[email protected]>
  */
 
+#include <linux/array_size.h>
+#include <linux/bitops.h>
+#include <linux/debugfs.h>
 #include <linux/device.h>
-#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/kstrtox.h>
+#include <linux/module.h>
 #include <linux/spi/spi.h>
+#include <linux/sprintf.h>
+#include <linux/stat.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
maintainer
#3 lore raw
In reply to Joshua Crofts
Quoted 4 lines · On Sun, 29 Nov 2026 20:33:35 +0100 Joshua Crofts <[email protected]> wrote:

Remove any kernel.h occurences in gyro/ and update the headers in accordance with IWYU (at least loosely).

Sashiko failed to apply. I can't be bothered to figure out why. This addressed the appropriate bits of what it called out on v1 so applied to the testing branch of iio.git.

Thanks,

Jonathan

Quoted 18 lines

---
Changes in v2:
- Address Sashiko review: a few missing and unused includes.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Joshua Crofts (2):
iio: gyro: adis16080: apply iwyu principle
iio: gyro: adis16136: apply iwyu principle

 drivers/iio/gyro/adis16080.c | 13 ++++++++-----
 drivers/iio/gyro/adis16136.c | 12 +++++++++---
 2 files changed, 17 insertions(+), 8 deletions(-)

---
base-commit: a6d01d696125566b722cde7293fb1735b7866be1
change-id: 20261120-gyro-kernel-header-removal-7e7ce8b60656

Best regards,

#4 lore raw
Quoted 10 lines · Jonathan Cameron
Quoted 4 lines · On Sun, 29 Nov 2026 20:33:35 +0100 Joshua Crofts <[email protected]> wrote:

Remove any kernel.h occurences in gyro/ and update the headers in accordance with IWYU (at least loosely).

Sashiko failed to apply. I can't be bothered to figure out why. This addressed the appropriate bits of what it called out on v1 so applied to the testing branch of iio.git.

Bad rebase unfortunately. Luckily nobody touched the drivers in the meantime.

Thanks.

Signature · 2 lines
Kind regards,
Joshua Crofts