Re: [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h
From: Andy Shevchenko
Date: Mon Dec 08 2025 - 08:21:44 EST
On Mon, Dec 08, 2025 at 12:30:59PM +0000, Tomas Melin wrote:
> No need to include the entire kernel.h when the only thing needed
> is the ARRAY_SIZE macro.
ARRAY_SIZE().
...
> --- a/drivers/iio/adc/ad9467.c
> +++ b/drivers/iio/adc/ad9467.c
> @@ -12,7 +12,7 @@
> #include <linux/module.h>
> #include <linux/mutex.h>
> #include <linux/device.h>
> -#include <linux/kernel.h>
> +#include <linux/array_size.h>
> #include <linux/slab.h>
> #include <linux/spi/spi.h>
> #include <linux/seq_file.h>
Please, keep them sorted.
...
While this change is almost (*) okay per se, I think we can address more
while at it.
- Make the header inclusions ordered (also fix the location of clk.h)
- drop other proxy (device.h) or unneeded headers (bitops.h as it's implied by bitmap.h)
- add missing ones (dev_printk.h, device/devres.h, ...)
(*) no, kernel.h provides more for this driver, for example, your patch
misses types.h.
--
With Best Regards,
Andy Shevchenko