[PATCH] iio: fix header includes across multiple drivers
Andy Shevchenko
andriy.shevchenko at intel.com
Fri Apr 24 02:45:36 PDT 2026
On Thu, Apr 23, 2026 at 01:45:12PM -0500, David Lechner wrote:
> On 4/23/26 1:33 PM, Caio Morais wrote:
> >
> > Remove unnecessary includes and add missing ones as reported by the
> > include-what-you-use (IWYU) tool.
> >
> > Files changed:
> > - drivers/iio/adc/xilinx-xadc-events.c
> > - drivers/iio/buffer/industrialio-triggered-buffer.c
> > - drivers/iio/common/st_sensors/st_sensors_i2c.c
> > - drivers/iio/common/st_sensors/st_sensors_spi.c
>
> We'll want to split these up, one patch per file in case they every
> need to be backported as a dependency to a fix.
Per driver actually, as the last two belong to the same driver
(different busses though).
...
> This looks like sorting alphabetically, not actually adding or removing
> any headers as seen by the equal number of insertions and deletions.
>
> Usually we don't bother with sorting unless we are making other
> changes on top of that.
Right. At bare minimum we expect sorting + IWYU patch series.
...
> > #include <linux/device.h>
> > #include <linux/err.h>
> > #include <linux/i2c.h>
> > +#include <linux/iio/iio.h>
> > #include <linux/linkage.h>
> > #include <linux/module.h>
> > #include <linux/regmap.h>
> > -#include <linux/iio/iio.h>
>
> On this one, it would be more logical to move the iio header
> down one line to group it with the one below.
Hmm... Personally I consider them different group, I would rather see
linux/*
...blank line...
linux/iio/*
...blank line...
linux/_whatever_driver_specific_
> > #include <linux/iio/common/st_sensors_i2c.h>
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list