2024-02-13 19:39:29

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v1 1/1] serial: 8250_pci1xxxx: Don't use "proxy" headers

Update header inclusions to follow IWYU (Include What You Use)
principle.

Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/tty/serial/8250/8250_pci1xxxx.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)

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>

--
2.43.0.rc1.1.gbec44491f096



2024-02-14 09:17:40

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] serial: 8250_pci1xxxx: Don't use "proxy" headers

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 <[email protected]>

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 <[email protected]>

--
js
suse labs


2024-02-14 12:59:05

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v1 1/1] serial: 8250_pci1xxxx: Don't use "proxy" headers

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 <[email protected]>
>
> 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 <[email protected]>

Thank you!

--
With Best Regards,
Andy Shevchenko