[v1,1/1] serial: 8250_pci1xxxx: Don't use "proxy" headers

Message ID 20240213193827.3207353-1-andriy.shevchenko@linux.intel.com
State New
Headers
Series [v1,1/1] serial: 8250_pci1xxxx: Don't use "proxy" headers |

Commit Message

Andy Shevchenko Feb. 13, 2024, 7:38 p.m. UTC
  Update header inclusions to follow IWYU (Include What You Use)
principle.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/tty/serial/8250/8250_pci1xxxx.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
  

Comments

Jiri Slaby Feb. 14, 2024, 9:15 a.m. UTC | #1
On 13. 02. 24, 20:38, Andy Shevchenko wrote:
> Update header inclusions to follow IWYU (Include What You Use)
> principle.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Looks good, but hard to tell if it is correct :P.

I like this qt-creator feature: "this header is not directly used, 
remove?". Maybe we could extend it to the kernel somehow (as it uses 
clang to decide, I suppose). As was shown recently, removing the 
inclusion hell can decrease the build time significantly…

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
  
Andy Shevchenko Feb. 14, 2024, 12:58 p.m. UTC | #2
On Wed, Feb 14, 2024 at 10:15:10AM +0100, Jiri Slaby wrote:
> On 13. 02. 24, 20:38, Andy Shevchenko wrote:
> > Update header inclusions to follow IWYU (Include What You Use)
> > principle.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Looks good, but hard to tell if it is correct :P.
> 
> I like this qt-creator feature: "this header is not directly used, remove?".
> Maybe we could extend it to the kernel somehow (as it uses clang to decide,
> I suppose). As was shown recently, removing the inclusion hell can decrease
> the build time significantly…

Yes, that's what Ingo's gigantic patch series targeted, but seems no-one is
interested enough to get it through. clang people also wanted to have a tool
like checkpatch for the inclusions or even like coccinelle to just fix the
code, but it's a project with no deadline or milestones AFAIK.

> Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

Thank you!
  

Patch

diff --git a/drivers/tty/serial/8250/8250_pci1xxxx.c b/drivers/tty/serial/8250/8250_pci1xxxx.c
index 356972734b29..55eada1dba56 100644
--- a/drivers/tty/serial/8250/8250_pci1xxxx.c
+++ b/drivers/tty/serial/8250/8250_pci1xxxx.c
@@ -7,23 +7,31 @@ 
  *  Copyright (C) 2022 Microchip Technology Inc., All Rights Reserved.
  */
 
+#include <linux/array_size.h>
 #include <linux/bitfield.h>
-#include <linux/bitops.h>
-#include <linux/delay.h>
+#include <linux/bits.h>
+#include <linux/circ_buf.h>
+#include <linux/device.h>
+#include <linux/errno.h>
+#include <linux/gfp_types.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>
-#include <linux/kernel.h>
+#include <linux/minmax.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/overflow.h>
 #include <linux/pci.h>
+#include <linux/pm.h>
 #include <linux/serial_core.h>
 #include <linux/serial_reg.h>
 #include <linux/serial_8250.h>
-#include <linux/slab.h>
+#include <linux/spinlock.h>
 #include <linux/string.h>
-#include <linux/units.h>
+#include <linux/time.h>
 #include <linux/tty.h>
 #include <linux/tty_flip.h>
-#include <linux/8250_pci.h>
+#include <linux/types.h>
+#include <linux/units.h>
 
 #include <asm/byteorder.h>