All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, "Andy Shevchenko" <andy@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Mike Looijmans" <mike.looijmans@topic.nl>,
	"Liam Beguin" <liambeguin@gmail.com>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Ibrahim Tilki" <Ibrahim.Tilki@analog.com>,
	"Cosmin Tanislav" <cosmin.tanislav@analog.com>,
	"Alisa-Dariana Roman" <alisadariana@gmail.com>,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH 04/11] iio: adc: max1027: Improve include relevance
Date: Tue, 20 Jan 2026 09:56:59 +0200	[thread overview]
Message-ID: <aW81S3XcVBnuYI71@smile.fi.intel.com> (raw)
In-Reply-To: <20260119212110.726941-5-jic23@kernel.org>

On Mon, Jan 19, 2026 at 09:21:03PM +0000, Jonathan Cameron wrote:

> Drop kernel.h in favor of more specific headers and add includes that were
> previously relying on other headers including them.
> 
> Whether to include device.h or the relevant sub headers is non obvious.
> In this case, there is an access to struct device for
> spi->dev.driver->name which is used to name the irq.
> 
> The justification from iwyu for the additional includes is:
>   #include <asm/byteorder.h>           // for be16_to_cpu
>   #include <linux/array_size.h>        // for ARRAY_SIZE
>   #include <linux/bitops.h>            // for BIT, GENMASK, fls, hweight32
>   #include <linux/cleanup.h>           // for guard
>   #include <linux/compiler.h>          // for __aligned
>   #include <linux/completion.h>        // for complete, init_completion

>   #include <linux/device.h>            // for dev_err, dev_name, devm_kmal. ..

Not good, we also should treat device.h as "include everything" and try to
avoid that, above comment hints like

dev_printk.h
device/devres.h

>   #include <linux/errno.h>             // for ENOMEM, EINVAL, EBUSY, ETIME...
>   #include <linux/interrupt.h>         // for devm_request_irq, irqreturn
>   #include <linux/jiffies.h>           // for msecs_to_jiffies
>   #include <linux/minmax.h>            // for __cmp_op_max
>   #include <linux/mutex.h>             // for class_mutex_constructor, cla...
>   #include <linux/stddef.h>            // for NULL, false
>   #include <linux/types.h>             // for u8, bool, __be16

> stddef.h not directly included as few drivers do this.

Yes, we assume that types guarantees stddef.h to be provided.

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> ---

Cc here...

>  drivers/iio/adc/max1027.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)

...

> +#include <linux/array_size.h>
> +#include <linux/bitops.h>
> +#include <linux/cleanup.h>

> +#include <linux/compiler.h>

Same as stddef. types.h will bring this.

> +#include <linux/completion.h>
>  #include <linux/delay.h>
> -#include <linux/kernel.h>

> +#include <linux/device.h>

See above.

> +#include <linux/errno.h>
> +#include <linux/interrupt.h>
> +#include <linux/jiffies.h>
> +#include <linux/minmax.h>
>  #include <linux/module.h>
>  #include <linux/mod_devicetable.h>
> +#include <linux/mutex.h>
> +#include <linux/printk.h>
>  #include <linux/spi/spi.h>
> +#include <linux/types.h>

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-01-20  7:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19 21:20 [PATCH 00/11] iio: adc: Improve include relevance for some ADCs Jonathan Cameron
2026-01-19 21:21 ` [PATCH 01/11] iio: adc: ltc2471: Improve include relevance Jonathan Cameron
2026-01-20  7:51   ` Andy Shevchenko
2026-01-19 21:21 ` [PATCH 02/11] iio: adc: ltc2309: " Jonathan Cameron
2026-01-20  7:52   ` Andy Shevchenko
2026-01-19 21:21 ` [PATCH 03/11] iio: adc: max1027: Reorder headers into alphabetical order Jonathan Cameron
2026-01-20  7:53   ` Andy Shevchenko
2026-01-19 21:21 ` [PATCH 04/11] iio: adc: max1027: Improve include relevance Jonathan Cameron
2026-01-20  7:56   ` Andy Shevchenko [this message]
2026-01-20 22:10     ` Jonathan Cameron
2026-01-20 22:52       ` Andy Shevchenko
2026-01-21  9:37   ` Nuno Sá
2026-01-19 21:21 ` [PATCH 05/11] iio: adc: max11100: " Jonathan Cameron
2026-01-19 21:21 ` [PATCH 06/11] iio: adc: max11410: Improve relevance of includes Jonathan Cameron
2026-01-19 21:21 ` [PATCH 07/11] iio: adc: ad4130: Improve include relevance Jonathan Cameron
2026-01-19 21:21 ` [PATCH 08/11] iio: adc: ad7124: " Jonathan Cameron
2026-01-19 21:21 ` [PATCH 09/11] iio: adc: ad7124: Replace device.h with more specific includes Jonathan Cameron
2026-01-19 21:21 ` [PATCH 10/11] iio: adc: ad7192: Put headers in alphabetical order Jonathan Cameron
2026-01-19 21:21 ` [PATCH 11/11] iio: adc: ad7192: Improve include relevance Jonathan Cameron
2026-01-20  7:58 ` [PATCH 00/11] iio: adc: Improve include relevance for some ADCs Andy Shevchenko
2026-01-21  9:41 ` Nuno Sá

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=aW81S3XcVBnuYI71@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=Ibrahim.Tilki@analog.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alisadariana@gmail.com \
    --cc=andy@kernel.org \
    --cc=cosmin.tanislav@analog.com \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=liambeguin@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=mike.looijmans@topic.nl \
    --cc=miquel.raynal@bootlin.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.