[PATCH 1/9] iio: adc: ad_sigma_delta: sort includes

David Lechner posted 9 patches 3 months, 2 weeks ago
There is a newer version of this series
[PATCH 1/9] iio: adc: ad_sigma_delta: sort includes
Posted by David Lechner 3 months, 2 weeks ago
Sort includes in alphabetical order and fix grouping before we add more.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/adc/ad_sigma_delta.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
index 4c5f8d29a559fea7226b84141bcb148fb801f62c..6cd3645eaaf38a23d5b6479ac598b6d276cfd81a 100644
--- a/drivers/iio/adc/ad_sigma_delta.c
+++ b/drivers/iio/adc/ad_sigma_delta.c
@@ -7,24 +7,22 @@
  */
 
 #include <linux/align.h>
-#include <linux/interrupt.h>
 #include <linux/device.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/spi/spi.h>
-#include <linux/err.h>
-#include <linux/module.h>
+#include <linux/unaligned.h>
 
+#include <linux/iio/adc/ad_sigma_delta.h>
+#include <linux/iio/buffer.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
-#include <linux/iio/buffer.h>
-#include <linux/iio/trigger.h>
 #include <linux/iio/trigger_consumer.h>
+#include <linux/iio/trigger.h>
 #include <linux/iio/triggered_buffer.h>
-#include <linux/iio/adc/ad_sigma_delta.h>
-
-#include <linux/unaligned.h>
-
 
 #define AD_SD_COMM_CHAN_MASK	0x3
 

-- 
2.43.0
Re: [PATCH 1/9] iio: adc: ad_sigma_delta: sort includes
Posted by Jonathan Cameron 3 months, 2 weeks ago
On Fri, 20 Jun 2025 17:20:07 -0500
David Lechner <dlechner@baylibre.com> wrote:

> Sort includes in alphabetical order and fix grouping before we add more.
> 
> Signed-off-by: David Lechner <dlechner@baylibre.com>
> ---
>  drivers/iio/adc/ad_sigma_delta.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
> index 4c5f8d29a559fea7226b84141bcb148fb801f62c..6cd3645eaaf38a23d5b6479ac598b6d276cfd81a 100644
> --- a/drivers/iio/adc/ad_sigma_delta.c
> +++ b/drivers/iio/adc/ad_sigma_delta.c
> @@ -7,24 +7,22 @@
>   */
>  
>  #include <linux/align.h>
> -#include <linux/interrupt.h>
>  #include <linux/device.h>
> +#include <linux/err.h>
> +#include <linux/interrupt.h>
>  #include <linux/kernel.h>
Andy normally points this out (and may well do here) but in
general if we are tidying up headers we should try to drop includes
of kernel.h if favour of more specific headers.

Doesn't need to be in same patch as this one though!

This is trivial and correct as it stands and would want to be
done as a precursor to any actual changes anyway.

> +#include <linux/module.h>
>  #include <linux/slab.h>
>  #include <linux/spi/spi.h>
> -#include <linux/err.h>
> -#include <linux/module.h>
> +#include <linux/unaligned.h>
>  
> +#include <linux/iio/adc/ad_sigma_delta.h>
> +#include <linux/iio/buffer.h>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/sysfs.h>
> -#include <linux/iio/buffer.h>
> -#include <linux/iio/trigger.h>
>  #include <linux/iio/trigger_consumer.h>
> +#include <linux/iio/trigger.h>
>  #include <linux/iio/triggered_buffer.h>
> -#include <linux/iio/adc/ad_sigma_delta.h>
> -
> -#include <linux/unaligned.h>
> -
>  
>  #define AD_SD_COMM_CHAN_MASK	0x3
>  
>
Re: [PATCH 1/9] iio: adc: ad_sigma_delta: sort includes
Posted by Andy Shevchenko 3 months, 2 weeks ago
On Sun, Jun 22, 2025 at 03:37:33PM +0100, Jonathan Cameron wrote:
> On Fri, 20 Jun 2025 17:20:07 -0500
> David Lechner <dlechner@baylibre.com> wrote:

...

> >  #include <linux/kernel.h>
> Andy normally points this out (and may well do here) but in
> general if we are tidying up headers we should try to drop includes
> of kernel.h if favour of more specific headers.
> 
> Doesn't need to be in same patch as this one though!
> 
> This is trivial and correct as it stands and would want to be
> done as a precursor to any actual changes anyway.

Yeah, kernel.h in the (leaf) drivers is a red flag to me.
But replacing it is out of scope of this patch and may be
done separately. My only point that please do it rather
sooner.

-- 
With Best Regards,
Andy Shevchenko