lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251206153338.57c4159b@jic23-huawei>
Date: Sat, 6 Dec 2025 15:33:38 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Rodrigo Gobbi <rodrigo.gobbi.7@...il.com>
Cc: dlechner@...libre.com, nuno.sa@...log.com, andy@...nel.org,
 ~lkcamp/patches@...ts.sr.ht, linux-iio@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] iio: adc: spear_adc: cleans up, update and sorts the
 existing includes

On Sat,  6 Dec 2025 10:15:12 -0300
Rodrigo Gobbi <rodrigo.gobbi.7@...il.com> wrote:

> Remove unused includes and add what is being used (IWYU principle) and
> sort the remaining ones.
> 
> Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@...il.com>
Hi Rodrigo,

Much closer but I still spotted one include I'm not sure needs
to be here.

> ---
> My reasoning was not correct at [1], tks for pointing that out @Jonathan.
> With that in mind, I've reviewed some discussions about the principle and
> I`ve changed a little bit approach: I`ve inspected the source code again
> to find  out what was being used and also checked incorrectly "indirect includes"
> using the spear_adc.i file to avoid them. The result is something like this now:
> 
> Removed:
> #include <linux/device.h>
> #include <linux/kernel.h>
> #include <linux/slab.h>
> #include <linux/iio/sysfs.h>
> 
> Added:
> #include <linux/array_size.h>
> #include <linux/bits.h>
> #include <linux/compiler_types.h>
> #include <linux/dev_printk.h>
> #include <linux/math.h>
> #include <linux/mutex.h>
> #include <linux/of.h>

For these, given we've been round a few times, it is useful to add a
brief on what is being used from each header in this change log or
indeed the patch description.

> 
> #include <linux/iio/types.h>
> 
> Tks and regards!
> 
> [1] https://lore.kernel.org/all/20251009182636.187026-1-rodrigo.gobbi.7@gmail.com/
> ---
>  drivers/iio/adc/spear_adc.c | 26 +++++++++++++++-----------
>  1 file changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/iio/adc/spear_adc.c b/drivers/iio/adc/spear_adc.c
> index 50b0a607baeb..b9eeed5533c6 100644
> --- a/drivers/iio/adc/spear_adc.c
> +++ b/drivers/iio/adc/spear_adc.c
> @@ -5,22 +5,26 @@
>   * Copyright 2012 Stefan Roese <sr@...x.de>
>   */
>  
> -#include <linux/mod_devicetable.h>
> -#include <linux/module.h>
> -#include <linux/platform_device.h>
> -#include <linux/property.h>
> -#include <linux/interrupt.h>
> -#include <linux/device.h>
> -#include <linux/kernel.h>
> -#include <linux/slab.h>
> -#include <linux/io.h>
> +#include <linux/array_size.h>
>  #include <linux/bitfield.h>
> +#include <linux/bits.h>
>  #include <linux/clk.h>
> -#include <linux/err.h>
> +#include <linux/compiler_types.h>
>  #include <linux/completion.h>
> +#include <linux/dev_printk.h>
> +#include <linux/err.h>
> +#include <linux/interrupt.h>
> +#include <linux/io.h>
> +#include <linux/math.h>
> +#include <linux/module.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/mutex.h>
> +#include <linux/of.h>

Why include of.h?

I'm not immediately seeing any use stuff defined in there
but I may be missing something.

The only thing prefixed with of_ is of_match_id which
is mod_devicetable.h

We've scrub unneeded includes of that file out of IIO a few
times in the past, so I don't really want to see new ones added.


> +#include <linux/platform_device.h>
> +#include <linux/property.h>
>  
>  #include <linux/iio/iio.h>
> -#include <linux/iio/sysfs.h>
> +#include <linux/iio/types.h>
>  
>  /* SPEAR registers definitions */
>  #define SPEAR600_ADC_SCAN_RATE_LO(x)	((x) & 0xFFFF)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ