Re: [PATCH v4 2/2] iio: adc: spear_adc: align headers with IWYU principle

Jonathan Cameron <[email protected]>
Newsgroups dev.linux.lists.linux-kernel-mentees,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <20260527112139.18f285fe@jic23-huawei>
On Tue, 26 May 2026 22:36:40 -0300
Rodrigo Gobbi <[email protected]> wrote:

> Remove unused includes and add what is being used:
> 
> #include <linux/array_size.h> // for ARRAY_SIZE
> #include <linux/bits.h>  // for GENMASKxx
> #include <linux/dev_printk.h> // for dev_err_probe, dev_info
> #include <linux/math.h>  // for DIV_ROUND_UP
> #include <linux/mutex.h> // for struct mutex
> #include <linux/types.h> // for uXX definitions
> #include <linux/iio/types.h> // for IIO_CHAN_INFO_*
> 
> Signed-off-by: Rodrigo Gobbi <[email protected]>
> ---
>  drivers/iio/adc/spear_adc.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/spear_adc.c b/drivers/iio/adc/spear_adc.c
> index efde6afc54fd..4be722406bb5 100644
> --- a/drivers/iio/adc/spear_adc.c
> +++ b/drivers/iio/adc/spear_adc.c
> @@ -5,22 +5,25 @@
>   * Copyright 2012 Stefan Roese <[email protected]>
>   */
>  
> +#include <linux/array_size.h>
>  #include <linux/bitfield.h>
> +#include <linux/bits.h>
>  #include <linux/clk.h>
>  #include <linux/completion.h>
> -#include <linux/device.h>
> +#include <linux/dev_printk.h>
>  #include <linux/err.h>
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
> -#include <linux/kernel.h>
> +#include <linux/math.h>
>  #include <linux/mod_devicetable.h>
>  #include <linux/module.h>
> +#include <linux/mutex.h>
>  #include <linux/platform_device.h>
>  #include <linux/property.h>
> -#include <linux/slab.h>
> +#include <linux/types.h>
>  
>  #include <linux/iio/iio.h>
> -#include <linux/iio/sysfs.h>
> +#include <linux/iio/types.h>

This one is in my 'maybe' list.  I'm fairly confident that
the main iio.h header will always include it. However that's
not necessarily obvious so I don't much mind including here anyway.

Anyhow, series applied to the testing branch of iio.git

Thanks,

Jonathan



>  
>  /* SPEAR registers definitions */
>  #define SPEAR600_ADC_SCAN_RATE_LO(x)	((x) & 0xFFFF)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.