public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Erick Henrique <erick.henrique.rodrigues@usp.br>
Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	andriy.shevchenko@intel.com, linux-iio@vger.kernel.org
Subject: Re: [PATCH v3 1/2] iio: dac: m62332: Clean up header includes
Date: Sun, 19 Apr 2026 13:16:53 +0100	[thread overview]
Message-ID: <20260419131653.7955c2d4@jic23-huawei> (raw)
In-Reply-To: <20260418130322.106769-2-erick.henrique.rodrigues@usp.br>

On Sat, 18 Apr 2026 10:03:21 -0300
Erick Henrique <erick.henrique.rodrigues@usp.br> wrote:

> Follow IWYU principle: explicitly include headers for symbols used
> in this file, remove unused slab.h, and sort alphabetically.
> 
> This prepares the driver for adding new functionality that requires
> additional headers.
> 
> Signed-off-by: Erick Henrique <erick.henrique.rodrigues@usp.br>
Hi Erick,

A few comments inline.

Thanks!

Jonathan

> ---
>  drivers/iio/dac/m62332.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/dac/m62332.c b/drivers/iio/dac/m62332.c
> index 3497513854d7..4b139904e818 100644
> --- a/drivers/iio/dac/m62332.c
> +++ b/drivers/iio/dac/m62332.c
> @@ -8,13 +8,18 @@
>   *  Copyright (C) 2010, 2011 Roland Stigge <stigge@antcom.de>
>   */
>  
> -#include <linux/module.h>
> -#include <linux/slab.h>
> -#include <linux/i2c.h>

Resorting and new includes in one go does make it harder to see what
is done. Generally I'd prefer that as two patches when we have more than 
a very small number of includes. Sort first, then add / remove headers
as needed.

> +#include <linux/array_size.h>
> +#include <linux/bits.h>
> +#include <linux/device.h>
This is one of the more complex corners of applying IWYU to kernel code.
device.h is a bit of a legacy 'catch all' and much like kernel.h the
general direction of travel is to include more specific headers instead.

You probably need a forwards definition of
struct device;
just after the includes however as the pointer type is used.
I'm not immediately spotting any other use of device.h rather various
more specific headers but I might be missing it.

>  #include <linux/err.h>
> +#include <linux/i2c.h>
> +#include <linux/module.h>

I'd expect to see
mod_devicetable.h in pretty much any IIO driver as that's where the ID
tables are coming from.

> +#include <linux/mutex.h>
> +#include <linux/pm.h>
> +#include <linux/types.h>
>  
> -#include <linux/iio/iio.h>
>  #include <linux/iio/driver.h>
> +#include <linux/iio/iio.h>
>  
>  #include <linux/regulator/consumer.h>
>  


  reply	other threads:[~2026-04-19 12:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-14 23:39 [PATCH] iio: dac: m62332: Use guard(mutex) for locking Erick Henrique
2026-04-15 10:20 ` Andy Shevchenko
2026-04-15 23:01 ` [PATCH v2] " Erick Henrique
2026-04-17  7:58   ` Andy Shevchenko
2026-04-17  7:59     ` Andy Shevchenko
2026-04-18 13:03 ` [PATCH v3 0/2] " Erick Henrique
2026-04-18 13:03   ` [PATCH v3 1/2] iio: dac: m62332: Clean up header includes Erick Henrique
2026-04-19 12:16     ` Jonathan Cameron [this message]
2026-04-18 13:03   ` [PATCH v3 2/2] iio: dac: m62332: Use guard(mutex) for locking Erick Henrique
2026-04-19 12:17     ` Jonathan Cameron
2026-04-19 13:49     ` Jonathan Cameron
2026-04-19 12:11   ` [PATCH v3 0/2] " Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260419131653.7955c2d4@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=erick.henrique.rodrigues@usp.br \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox