From: Jonathan Cameron <jic23@kernel.org>
To: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: "Rafael G. Dias" <rafael.guimaraes.dias@usp.br>,
dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
Felipe Khoury Dayoub <felipedayoub@usp.br>,
linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: light: stk3310: update includes to match IWYU
Date: Tue, 28 Apr 2026 16:05:33 +0100 [thread overview]
Message-ID: <20260428160533.47e4e820@jic23-huawei> (raw)
In-Reply-To: <CALoEA-wd9jo_bPCGF0GqLH9SX7vWsCN7oyvkN3Q86R0F=WTjog@mail.gmail.com>
On Tue, 28 Apr 2026 16:33:17 +0200
Joshua Crofts <joshua.crofts1@gmail.com> wrote:
> On Tue, 28 Apr 2026 at 16:13, Rafael G. Dias
> <rafael.guimaraes.dias@usp.br> wrote:
> >
Reviewing on top to avoid repeating the stuff Joshua has
already pointed out (thanks Joshua!)
> > +#include <linux/array_size.h>
> > +#include <linux/bits.h>
> > +#include <linux/device.h>
This is a bit like kernel.h in that it's mostly a catch all header
that we are trying stop including directly. However, it does still
contain some stuff. I'm not immediately seeing why need it here?
struct device * is used a lot but a forward definition will do for that
(put any of those needed after the headers0
> > +#include <linux/dev_printk.h>
> > +#include <linux/err.h>
> > +#include <linux/errno.h>
> > #include <linux/i2c.h>
> > -#include <linux/interrupt.h>
> > -#include <linux/kernel.h>
> > -#include <linux/module.h>
> > -#include <linux/mod_devicetable.h>
> > -#include <linux/regmap.h>
> > #include <linux/iio/events.h>
> > #include <linux/iio/iio.h>
> > #include <linux/iio/sysfs.h>
> > +#include <linux/iio/types.h>
>
> It's better to group the <linux/iio/*> headers separately from
> the generic <linux/*> headers, usually below them.
>
> > +#include <linux/interrupt.h>
> > +#include <linux/irqreturn.h>
> > +#include <linux/kconfig.h>
>
> I don't think you need this.
>
> > +#include <linux/mod_devicetable.h>
> > +#include <linux/module.h>
> > +#include <linux/mutex.h>
> > +#include <linux/pm.h>
> > +#include <linux/property.h>
> > +#include <linux/regmap.h>
> > +#include <linux/sprintf.h>
> > +#include <linux/stddef.h>
>
> You don't need to include this.
>
> > +#include <linux/sysfs.h>
>
> Remove this too, the driver already uses the linux/iio/sysfs.h
> variant.
>
> > +#include <linux/types.h>
>
> It would be better if you split this change into two patches,
> first the ordering, then the removal/addition of headers. It
> improves the reviewing process.
Agreed!
>
> Although IWYU is a pretty good tool, it generates a lot of
> noise, some of it not really valid.
>
Absolutely - I've had a few goes at putting together a 'standard'
config file for it, but never managed to make it do things correctly
for some corner cases.
Jonathan
next prev parent reply other threads:[~2026-04-28 15:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 13:41 [PATCH] iio: light: stk3310: update includes to match IWYU Rafael G. Dias
2026-04-28 14:33 ` Joshua Crofts
2026-04-28 15:05 ` Jonathan Cameron [this message]
2026-04-29 19:39 ` Andy Shevchenko
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=20260428160533.47e4e820@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=felipedayoub@usp.br \
--cc=joshua.crofts1@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=rafael.guimaraes.dias@usp.br \
/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