drivers/staging/iio/frequency/ad9834.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
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
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
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
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
© 2016 - 2026 Red Hat, Inc.