* [PATCH v2] iio: frequency: ad9834: clean up includes
@ 2026-04-15 11:20 Joshua Crofts
2026-04-15 14:37 ` Andy Shevchenko
0 siblings, 1 reply; 4+ messages in thread
From: Joshua Crofts @ 2026-04-15 11:20 UTC (permalink / raw)
To: lars, Michael.Hennerich, jic23, gregkh
Cc: dlechner, nuno.sa, andy, linux-iio, linux-staging, linux-kernel,
Joshua Crofts
Cleanup include headers by removing proxy kernel.h
header and unnecessary list.h, interrupt.h, workqueue.h
and slab.h headers. Reordered remaining drivers
alphabetically.
Verified using IWYU.
Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
v2:
- dropped patches from from previous iteration of
patch series
- removed additional unused headers
- returned bits.h as driver only uses BIT() macro
drivers/staging/iio/frequency/ad9834.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c
index d339d5e8e0..465b2fa7a4 100644
--- a/drivers/staging/iio/frequency/ad9834.c
+++ b/drivers/staging/iio/frequency/ad9834.c
@@ -5,18 +5,15 @@
* Copyright 2010-2011 Analog Devices Inc.
*/
+#include <linux/bits.h>
#include <linux/clk.h>
-#include <linux/interrupt.h>
-#include <linux/workqueue.h>
#include <linux/device.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/sysfs.h>
-#include <linux/list.h>
-#include <linux/spi/spi.h>
-#include <linux/regulator/consumer.h>
#include <linux/err.h>
#include <linux/module.h>
+#include <linux/regulator/consumer.h>
+#include <linux/spi/spi.h>
+#include <linux/sysfs.h>
+
#include <asm/div64.h>
#include <linux/iio/iio.h>
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] iio: frequency: ad9834: clean up includes
2026-04-15 11:20 [PATCH v2] iio: frequency: ad9834: clean up includes Joshua Crofts
@ 2026-04-15 14:37 ` Andy Shevchenko
2026-04-16 9:05 ` Joshua Crofts
0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2026-04-15 14:37 UTC (permalink / raw)
To: Joshua Crofts
Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy,
linux-iio, linux-staging, linux-kernel
On Wed, Apr 15, 2026 at 11:20:30AM +0000, Joshua Crofts wrote:
> Cleanup include headers by removing proxy kernel.h
> header and unnecessary list.h, interrupt.h, workqueue.h
> and slab.h headers. Reordered remaining drivers
s/drivers/headers/
> alphabetically.
>
> Verified using IWYU.
Probably you need to somehow elaborate that this is tool, IWYU is the acronym
of the principle, tool called 'iwyu'. Maybe adding a link?
"Verified with help of IWYU tool (...here is URL...).
> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
...
> +#include <linux/bits.h>
> #include <linux/clk.h>
> -#include <linux/interrupt.h>
> -#include <linux/workqueue.h>
> #include <linux/device.h>
> -#include <linux/kernel.h>
> -#include <linux/slab.h>
> -#include <linux/sysfs.h>
> -#include <linux/list.h>
> -#include <linux/spi/spi.h>
> -#include <linux/regulator/consumer.h>
> #include <linux/err.h>
> #include <linux/module.h>
> +#include <linux/regulator/consumer.h>
> +#include <linux/spi/spi.h>
> +#include <linux/sysfs.h>
Still missing types.h, math.h, and probably more...
Yes, asm/byteorder.h, kstrtox.h, mutex.h. And maybe even more, I just
briefly scrolled over the driver code.
If you look at Git history of the replacement kernel.h in the drivers
you may find that usually it takes 10+ headers to be added.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] iio: frequency: ad9834: clean up includes
2026-04-15 14:37 ` Andy Shevchenko
@ 2026-04-16 9:05 ` Joshua Crofts
2026-04-16 9:20 ` Andy Shevchenko
0 siblings, 1 reply; 4+ messages in thread
From: Joshua Crofts @ 2026-04-16 9:05 UTC (permalink / raw)
To: Andy Shevchenko
Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy,
linux-iio, linux-staging, linux-kernel
On Wed, 15 Apr 2026 at 16:37, Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:
> Still missing types.h, math.h, and probably more...
I don't get why I should include a math header (I presume you meant
something like linux/math64.h), since we're only using do_div(),
which is a macro from asm/div64.h (which linux/math64.h includes).
Last time I came up with this, you recommended working on this in
another patch.
--
Kind regards
CJD
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] iio: frequency: ad9834: clean up includes
2026-04-16 9:05 ` Joshua Crofts
@ 2026-04-16 9:20 ` Andy Shevchenko
0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-04-16 9:20 UTC (permalink / raw)
To: Joshua Crofts
Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy,
linux-iio, linux-staging, linux-kernel
On Thu, Apr 16, 2026 at 11:05:21AM +0200, Joshua Crofts wrote:
> On Wed, 15 Apr 2026 at 16:37, Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> > Still missing types.h, math.h, and probably more...
> I don't get why I should include a math header (I presume you meant
> something like linux/math64.h), since we're only using do_div(),
> which is a macro from asm/div64.h (which linux/math64.h includes).
> Last time I came up with this, you recommended working on this in
> another patch.
Ah, sorry, yes, currently included asm/div64.h is fine. If we ever
want to replace that, we need to do it treewide.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-04-16 9:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-15 11:20 [PATCH v2] iio: frequency: ad9834: clean up includes Joshua Crofts
2026-04-15 14:37 ` Andy Shevchenko
2026-04-16 9:05 ` Joshua Crofts
2026-04-16 9:20 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox