All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: nuno.sa@analog.com, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	David Lechner <dlechner@baylibre.com>,
	Andy Shevchenko <andy@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Subject: Re: [PATCH v4 10/12] iio: dac: ad5446: Refactor header inclusion
Date: Sun, 9 Nov 2025 21:32:35 +0200	[thread overview]
Message-ID: <aRDsU-Zy49vm7N0R@smile.fi.intel.com> (raw)
In-Reply-To: <20251109163030.66ad74fa@jic23-huawei>

On Sun, Nov 09, 2025 at 04:30:30PM +0000, Jonathan Cameron wrote:
> On Tue, 4 Nov 2025 20:24:19 +0200
> Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > On Tue, Nov 04, 2025 at 03:35:15PM +0000, Nuno Sá via B4 Relay wrote:

...

> > > +#include <linux/export.h>
> > >  #include <linux/iio/iio.h>
> > > +#include <linux/kstrtox.h>
> > > +#include <linux/module.h>
> > > +#include <linux/mutex.h>
> > > +#include <linux/regulator/consumer.h>
> > > +#include <linux/sysfs.h>  
> > 
> > Most likely the types.h is missing and maybe more...
> 
> Looks like types.h belongs only in the header.

Hmm... IIRC my suggestion was based on seeing one of uXX/sXX in the code,
but now I lost the context and maybe I memorised that wrongly.

> FWIW I ran iwyu against this with my usual iio.imp file
> (shared previously on list)
> 
> drivers/iio/dac/ad5446.h should add these lines:
> #include <linux/compiler.h>  // for __aligned
> #include <linux/minmax.h>    // for __cmp_op_max
> #include <linux/stddef.h>    // for NULL
> 
> drivers/iio/dac/ad5446.h should remove these lines:
> 
> The full include-list for drivers/iio/dac/ad5446.h:
> #include <linux/bits.h>      // for BIT
> #include <linux/compiler.h>  // for __aligned
> #include <linux/iio/iio.h>   // for IIO_DMA_MINALIGN, iio_chan_spec
> #include <linux/minmax.h>    // for __cmp_op_max
> #include <linux/mutex.h>     // for mutex
> #include <linux/stddef.h>    // for NULL
> #include <linux/types.h>     // for __be16, u16, u8
> struct device;  // lines 10-10
> ---
> 
> So maybe those 3 extra in the header  but seem not much needed in the c file.
> 
> Hence applied with the compiler.h one added to the header.
> Whereever that minmax is coming from is burried deep in macro
> so probably isn't appropriate anyway

If we use min()/max() or something from there it relies on the __cmp_op_max(),
so probably it's needed.

> and including stddef for NULL seems over the top.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-11-09 19:32 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04 15:35 [PATCH v4 00/12] iio: dac: ad5446: Refactor and add support for AD5542 Nuno Sá
2025-11-04 15:35 ` Nuno Sá via B4 Relay
2025-11-04 15:35 ` [PATCH v4 01/12] dt-bindings: iio: dac: Document AD5446 and similar devices Nuno Sá
2025-11-04 15:35   ` Nuno Sá via B4 Relay
2025-11-04 17:51   ` [PATCH v5 6/7] dt-bindings: clock: rockchip: Add RK3506 clock and reset unit Conor Dooley
2025-11-09 15:57     ` Jonathan Cameron
2025-11-09 19:51       ` Conor Dooley
2025-11-09 16:05   ` [PATCH v4 01/12] dt-bindings: iio: dac: Document AD5446 and similar devices Jonathan Cameron
2025-11-04 15:35 ` [PATCH v4 02/12] iio: dac: ad5446: Use DMA safe buffer for transfers Nuno Sá
2025-11-04 15:35   ` Nuno Sá via B4 Relay
2025-11-04 17:10   ` Andy Shevchenko
2025-11-09 16:04     ` Jonathan Cameron
2025-11-04 15:35 ` [PATCH v4 03/12] iio: dac: ad5446: Drop duplicated spi_id entry Nuno Sá
2025-11-04 15:35   ` Nuno Sá via B4 Relay
2025-11-04 17:12   ` Andy Shevchenko
2025-11-05 10:16     ` Nuno Sá
2025-11-09 16:05       ` Jonathan Cameron
2025-11-04 15:35 ` [PATCH v4 04/12] iio: dac: ad5446: Don't ignore missing regulator Nuno Sá
2025-11-04 15:35   ` Nuno Sá via B4 Relay
2025-11-09 16:05   ` Jonathan Cameron
2025-11-04 15:35 ` [PATCH v4 05/12] iio: dac: ad5446: Move to single chip_info structures Nuno Sá
2025-11-04 15:35   ` Nuno Sá via B4 Relay
2025-11-09 16:06   ` Jonathan Cameron
2025-11-04 15:35 ` [PATCH v4 06/12] iio: dac: ad5456: Add missing DT compatibles Nuno Sá
2025-11-04 15:35   ` Nuno Sá via B4 Relay
2025-11-09 16:13   ` Jonathan Cameron
2025-11-04 15:35 ` [PATCH v4 07/12] iio: dac: ad5446: Separate I2C/SPI into different drivers Nuno Sá
2025-11-04 15:35   ` Nuno Sá via B4 Relay
2025-11-04 18:20   ` Andy Shevchenko
2025-11-09 15:55     ` Jonathan Cameron
2025-11-09 16:13     ` Jonathan Cameron
2025-11-09 16:16   ` Jonathan Cameron
2025-11-10 15:11     ` Nuno Sá
2025-11-04 15:35 ` [PATCH v4 08/12] iio: dac: ad5446: Make use of devm_mutex_init() Nuno Sá
2025-11-04 15:35   ` Nuno Sá via B4 Relay
2025-11-09 16:16   ` Jonathan Cameron
2025-11-04 15:35 ` [PATCH v4 09/12] iio: dac: ad5446: Make use of the cleanup helpers Nuno Sá
2025-11-04 15:35   ` Nuno Sá via B4 Relay
2025-11-04 18:23   ` Andy Shevchenko
2025-11-09 16:19     ` Jonathan Cameron
2025-11-04 15:35 ` [PATCH v4 10/12] iio: dac: ad5446: Refactor header inclusion Nuno Sá
2025-11-04 15:35   ` Nuno Sá via B4 Relay
2025-11-04 18:24   ` Andy Shevchenko
2025-11-09 16:30     ` Jonathan Cameron
2025-11-09 19:32       ` Andy Shevchenko [this message]
2025-11-11 19:25         ` Jonathan Cameron
2025-11-04 15:35 ` [PATCH v4 11/12] iio: dac: ad5446: Fix coding style issues Nuno Sá
2025-11-04 15:35   ` Nuno Sá via B4 Relay
2025-11-04 18:26   ` Andy Shevchenko
2025-11-09 16:32     ` Jonathan Cameron
2025-11-04 15:35 ` [PATCH v4 12/12] iio: dac: ad5446: Add AD5542 to the spi id table Nuno Sá
2025-11-04 15:35   ` Nuno Sá via B4 Relay
2025-11-09 16:32   ` Jonathan Cameron
2025-11-04 18:30 ` [PATCH v4 00/12] iio: dac: ad5446: Refactor and add support for AD5542 Andy Shevchenko
2025-11-05 10:16   ` 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=aRDsU-Zy49vm7N0R@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=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /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.