diff mbox series

[v2,6/6] mmc: sdhci-acpi: Don't use "proxy" headers

Message ID 20241101101441.3518612-7-andriy.shevchenko@linux.intel.com
State New
Headers show
Series mmc: sdhci-acpi: A few cleanups | expand

Commit Message

Andy Shevchenko Nov. 1, 2024, 10:11 a.m. UTC
Update header inclusions to follow IWYU (Include What You Use) principle.
While at it, sort them alphabetically for better maintenance.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mmc/host/sdhci-acpi.c | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

Comments

Adrian Hunter Dec. 9, 2024, 11:32 a.m. UTC | #1
On 1/11/24 12:11, Andy Shevchenko wrote:
> Update header inclusions to follow IWYU (Include What You Use) principle.
> While at it, sort them alphabetically for better maintenance.

Not a fan of alphabetical order for include files.
In this case it makes it hard to see what actually
changed.

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/mmc/host/sdhci-acpi.c | 33 ++++++++++++++++++---------------
>  1 file changed, 18 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index c931f506c1b0..fcb69a509c1e 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -5,27 +5,30 @@
>   * Copyright (c) 2012, Intel Corporation.
>   */
>  
> +#include <linux/acpi.h>
>  #include <linux/bitfield.h>
> -#include <linux/init.h>
> -#include <linux/export.h>
> -#include <linux/module.h>
> +#include <linux/bitops.h>
> +#include <linux/compiler.h>
> +#include <linux/delay.h>
>  #include <linux/device.h>
> +#include <linux/dma-mapping.h>
> +#include <linux/dmi.h>
> +#include <linux/err.h>
> +#include <linux/errno.h>
> +#include <linux/export.h>
> +#include <linux/init.h>
> +#include <linux/interrupt.h>
> +#include <linux/io.h>
> +#include <linux/ioport.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/module.h>
>  #include <linux/pinctrl/pinconf-generic.h>
>  #include <linux/platform_device.h>
> -#include <linux/ioport.h>
> -#include <linux/io.h>
> -#include <linux/dma-mapping.h>
> -#include <linux/compiler.h>
> -#include <linux/stddef.h>
> -#include <linux/bitops.h>
> -#include <linux/types.h>
> -#include <linux/err.h>
> -#include <linux/interrupt.h>
> -#include <linux/acpi.h>
>  #include <linux/pm.h>
>  #include <linux/pm_runtime.h>
> -#include <linux/delay.h>
> -#include <linux/dmi.h>
> +#include <linux/stddef.h>
> +#include <linux/types.h>
> +#include <linux/uuid.h>
>  
>  #include <linux/mmc/host.h>
>  #include <linux/mmc/pm.h>
Andy Shevchenko Dec. 9, 2024, 4:43 p.m. UTC | #2
On Mon, Dec 09, 2024 at 01:32:36PM +0200, Adrian Hunter wrote:
> On 1/11/24 12:11, Andy Shevchenko wrote:
> > Update header inclusions to follow IWYU (Include What You Use) principle.
> > While at it, sort them alphabetically for better maintenance.
> 
> Not a fan of alphabetical order for include files.
> In this case it makes it hard to see what actually
> changed.

Huh?! It will be quite easy to see if anything is being added or removed and
makes code robust against (possible) duplications. Much easier to maintain!

If you are talking about _this_ change, then it's true, but only for _this_
change, and not for the future changes. Alphabetical order is natural for
humans (and we write code for humans) which our brains are trained for. So
the processing time of the ordered data is higher and less resource-consuming.
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index c931f506c1b0..fcb69a509c1e 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -5,27 +5,30 @@ 
  * Copyright (c) 2012, Intel Corporation.
  */
 
+#include <linux/acpi.h>
 #include <linux/bitfield.h>
-#include <linux/init.h>
-#include <linux/export.h>
-#include <linux/module.h>
+#include <linux/bitops.h>
+#include <linux/compiler.h>
+#include <linux/delay.h>
 #include <linux/device.h>
+#include <linux/dma-mapping.h>
+#include <linux/dmi.h>
+#include <linux/err.h>
+#include <linux/errno.h>
+#include <linux/export.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/ioport.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
 #include <linux/pinctrl/pinconf-generic.h>
 #include <linux/platform_device.h>
-#include <linux/ioport.h>
-#include <linux/io.h>
-#include <linux/dma-mapping.h>
-#include <linux/compiler.h>
-#include <linux/stddef.h>
-#include <linux/bitops.h>
-#include <linux/types.h>
-#include <linux/err.h>
-#include <linux/interrupt.h>
-#include <linux/acpi.h>
 #include <linux/pm.h>
 #include <linux/pm_runtime.h>
-#include <linux/delay.h>
-#include <linux/dmi.h>
+#include <linux/stddef.h>
+#include <linux/types.h>
+#include <linux/uuid.h>
 
 #include <linux/mmc/host.h>
 #include <linux/mmc/pm.h>