linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Tomas Melin <tomas.melin@vaisala.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Nuno Sa <nuno.sa@analog.com>, Jonathan Cameron <jic23@kernel.org>,
	David Lechner <dlechner@baylibre.com>,
	Andy Shevchenko <andy@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h
Date: Mon, 8 Dec 2025 17:58:52 +0200	[thread overview]
Message-ID: <aTb1vEEJRY6Uom2l@smile.fi.intel.com> (raw)
In-Reply-To: <1467f6e5-9d50-4b51-a283-aec19c031470@vaisala.com>

On Mon, Dec 08, 2025 at 05:41:20PM +0200, Tomas Melin wrote:
> On 08/12/2025 15:20, Andy Shevchenko wrote:
> > On Mon, Dec 08, 2025 at 12:30:59PM +0000, Tomas Melin wrote:
> >> No need to include the entire kernel.h when the only thing needed
> >> is the ARRAY_SIZE macro.
> > 
> > ARRAY_SIZE().

Please, remove context you are agree with.

...

> >>  #include <linux/module.h>
> >>  #include <linux/mutex.h>
> >>  #include <linux/device.h>
> >> -#include <linux/kernel.h>
> >> +#include <linux/array_size.h>
> >>  #include <linux/slab.h>
> >>  #include <linux/spi/spi.h>
> >>  #include <linux/seq_file.h>
> > 
> > Please, keep them sorted.
> These were unfortunately not sorted to start with.

But your patch makes situation even worse. That's what I meant by the comment.
Since there is no a* header, it may be put to the proper location from day 1.

...

> > While this change is almost (*) okay per se, I think we can address more
> > while at it.
> > - Make the header inclusions ordered (also fix the location of clk.h)
> > - drop other proxy (device.h) or unneeded headers (bitops.h as it's implied by bitmap.h)
> > - add missing ones (dev_printk.h, device/devres.h, ...)
> 
> As this change (kernel.h) does not seem at all as straightforward as I
> envisoned based on your initial request, I will likely change this patch
> to instead just sort the headers. Reworking the includes is separate
> topic from the intent of this patch series.

If you don't feel going that deep, than it's a (small) problem.

As the author of a driver feature one should understand slightly more about
this (yeah, currently mess) header stuff. So, your first patch should add
missed headers, if any, that's required to your changes, this one can be
omitted after all.

But on some day you will still need to understand a bit more about headers...

TL;DR: make sure you have all needed headers for your changes in the previous
patch and drop this one.

> > (*) no, kernel.h provides more for this driver, for example, your patch
> > misses types.h.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-12-08 15:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-08 12:30 [PATCH v3 0/3] iio: adc: ad9467: add support for ad9211 Tomas Melin
2025-12-08 12:30 ` [PATCH v3 1/3] dt-bindings: " Tomas Melin
2025-12-08 12:30 ` [PATCH v3 2/3] iio: " Tomas Melin
2025-12-08 13:27   ` Andy Shevchenko
2025-12-08 12:30 ` [PATCH v3 3/3] iio: adc: ad9467: drop kernel.h in favor of array_size.h Tomas Melin
2025-12-08 13:20   ` Andy Shevchenko
2025-12-08 15:41     ` Tomas Melin
2025-12-08 15:58       ` Andy Shevchenko [this message]
2025-12-08 16:21         ` Tomas Melin
2025-12-08 16:23           ` 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=aTb1vEEJRY6Uom2l@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=tomas.melin@vaisala.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;
as well as URLs for NNTP newsgroup(s).