* [PATCH v2 0/2] staging: iio: addac: adt7316: clean up header inclusions
@ 2026-10-30 10:47 Abdelnasser Hussein
2026-10-30 10:47 ` [PATCH v2 1/2] staging: iio: addac: adt7316: replace kernel.h with bits.h and kstrtox.h Abdelnasser Hussein
2026-10-30 10:47 ` [PATCH v2 2/2] staging: iio: addac: adt7316: explicitly include missing headers and sort Abdelnasser Hussein
0 siblings, 2 replies; 4+ messages in thread
From: Abdelnasser Hussein @ 2026-10-30 10:47 UTC (permalink / raw)
To: Jonathan Cameron, Greg Kroah-Hartman, Nuno Sa, Michael Hennerich
Cc: David Lechner, Andy Shevchenko, linux-iio, linux-staging, linux,
linux-kernel, Abdelnasser Hussein
This series cleans up header inclusions in adt7316.c
The changes are split into two logical patches:
1. Drop proxy header <linux/kernel.h> and explicitly include
<linux/bits.h> and <linux/kstrtox.h> per IWYU.
2. Explicitly include missing headers (<linux/err.h>, <linux/errno.h>,
<linux/pm.h>, <linux/string.h>, and <linux/types.h>), drop unused
headers, and sort the remaining headers alphabetically.
Note: <linux/device.h> is retained because the driver explicitly calls
dev_get_drvdata() and dev_set_drvdata().
v2:
- Split the original patch into a 2-patch series.
- Dropped proxy header <linux/kernel.h> and included <linux/bits.h>
and <linux/kstrtox.h>.
- Explicitly included missing headers for types, errors, and PM ops.
- Retained <linux/device.h> for device drvdata functions.
Abdelnasser Hussein (2):
staging: iio: addac: adt7316: replace kernel.h with bits.h and
kstrtox.h
staging: iio: addac: adt7316: explicitly include missing headers and
sort
drivers/staging/iio/addac/adt7316.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
--
2.56.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] staging: iio: addac: adt7316: replace kernel.h with bits.h and kstrtox.h
2026-10-30 10:47 [PATCH v2 0/2] staging: iio: addac: adt7316: clean up header inclusions Abdelnasser Hussein
@ 2026-10-30 10:47 ` Abdelnasser Hussein
2026-10-30 10:47 ` [PATCH v2 2/2] staging: iio: addac: adt7316: explicitly include missing headers and sort Abdelnasser Hussein
1 sibling, 0 replies; 4+ messages in thread
From: Abdelnasser Hussein @ 2026-10-30 10:47 UTC (permalink / raw)
To: Jonathan Cameron, Greg Kroah-Hartman, Nuno Sa, Michael Hennerich
Cc: David Lechner, Andy Shevchenko, linux-iio, linux-staging, linux,
linux-kernel, Abdelnasser Hussein
Drop the proxy header <linux/kernel.h> and explicitly include
<linux/bits.h> for BIT() macro and <linux/kstrtox.h> for
kstrtou8(), kstrtou16(), and kstrtoint() conversions.
Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
---
drivers/staging/iio/addac/adt7316.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c
index 20f6052cc7fb..d4b759ef637c 100644
--- a/drivers/staging/iio/addac/adt7316.c
+++ b/drivers/staging/iio/addac/adt7316.c
@@ -10,7 +10,8 @@
#include <linux/irq.h>
#include <linux/workqueue.h>
#include <linux/device.h>
-#include <linux/kernel.h>
+#include <linux/bits.h>
+#include <linux/kstrtox.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/list.h>
--
2.56.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] staging: iio: addac: adt7316: explicitly include missing headers and sort
2026-10-30 10:47 [PATCH v2 0/2] staging: iio: addac: adt7316: clean up header inclusions Abdelnasser Hussein
2026-10-30 10:47 ` [PATCH v2 1/2] staging: iio: addac: adt7316: replace kernel.h with bits.h and kstrtox.h Abdelnasser Hussein
@ 2026-10-30 10:47 ` Abdelnasser Hussein
2026-10-30 11:40 ` Joshua Crofts
1 sibling, 1 reply; 4+ messages in thread
From: Abdelnasser Hussein @ 2026-10-30 10:47 UTC (permalink / raw)
To: Jonathan Cameron, Greg Kroah-Hartman, Nuno Sa, Michael Hennerich
Cc: David Lechner, Andy Shevchenko, linux-iio, linux-staging, linux,
linux-kernel, Abdelnasser Hussein
Explicitly include <linux/err.h>, <linux/errno.h>, <linux/pm.h>,
<linux/string.h>, and <linux/types.h> for error handling, error codes,
EXPORT_GPL_SIMPLE_DEV_PM_OPS(), memcmp(), and fixed-width types. Drop
unused headers and sort the remaining headers alphabetically.
Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
---
drivers/staging/iio/addac/adt7316.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c
index d4b759ef637c..54d942cae586 100644
--- a/drivers/staging/iio/addac/adt7316.c
+++ b/drivers/staging/iio/addac/adt7316.c
@@ -5,23 +5,24 @@
* Copyright 2010 Analog Devices Inc.
*/
-#include <linux/interrupt.h>
+#include <linux/bits.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/errno.h>
#include <linux/gpio/consumer.h>
+#include <linux/interrupt.h>
#include <linux/irq.h>
-#include <linux/workqueue.h>
-#include <linux/device.h>
-#include <linux/bits.h>
#include <linux/kstrtox.h>
-#include <linux/slab.h>
-#include <linux/sysfs.h>
-#include <linux/list.h>
-#include <linux/i2c.h>
-#include <linux/rtc.h>
#include <linux/module.h>
+#include <linux/pm.h>
+#include <linux/string.h>
+#include <linux/sysfs.h>
+#include <linux/types.h>
-#include <linux/iio/iio.h>
#include <linux/iio/events.h>
+#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
+
#include "adt7316.h"
/*
--
2.56.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] staging: iio: addac: adt7316: explicitly include missing headers and sort
2026-10-30 10:47 ` [PATCH v2 2/2] staging: iio: addac: adt7316: explicitly include missing headers and sort Abdelnasser Hussein
@ 2026-10-30 11:40 ` Joshua Crofts
0 siblings, 0 replies; 4+ messages in thread
From: Joshua Crofts @ 2026-10-30 11:40 UTC (permalink / raw)
To: Abdelnasser Hussein
Cc: Jonathan Cameron, Greg Kroah-Hartman, Nuno Sa, Michael Hennerich,
David Lechner, Andy Shevchenko, linux-iio, linux-staging, linux,
linux-kernel
On Fri, 30 Oct 2026 12:47:45 +0200
Abdelnasser Hussein <abdelnasserhussein11@gmail.com> wrote:
> Explicitly include <linux/err.h>, <linux/errno.h>, <linux/pm.h>,
> <linux/string.h>, and <linux/types.h> for error handling, error codes,
> EXPORT_GPL_SIMPLE_DEV_PM_OPS(), memcmp(), and fixed-width types. Drop
> unused headers and sort the remaining headers alphabetically.
>
Better if patch 1 only sorts the list and patch 2 removes kernel.h
and adds/removes headers - it will be more readable that way. Have
a look at this patch series I sent some time ago [1] for reference.
[1] https://lore.kernel.org/all/20260831-kernel-header-removal-v2-0-b92b580ef5eb@gmail.com/
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-30 11:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-30 10:47 [PATCH v2 0/2] staging: iio: addac: adt7316: clean up header inclusions Abdelnasser Hussein
2026-10-30 10:47 ` [PATCH v2 1/2] staging: iio: addac: adt7316: replace kernel.h with bits.h and kstrtox.h Abdelnasser Hussein
2026-10-30 10:47 ` [PATCH v2 2/2] staging: iio: addac: adt7316: explicitly include missing headers and sort Abdelnasser Hussein
2026-10-30 11:40 ` Joshua Crofts
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®