Skip to contentSkip to conversation

leds: expresswire: Don't use "proxy" headers

PATCH Applied Andy Shevchenko 4 participants 8 messages Feb 23, 2024 – Feb 29, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 leds: expresswire: Don't use "proxy" headers

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

---
v2: added one more missing header

 drivers/leds/leds-expresswire.c  | 4 ++++
 include/linux/leds-expresswire.h | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/leds/leds-expresswire.c +4 -0
index 89e147b0e019..e4937a8e0f44 100644
@@ -5,8 +5,12 @@
  * ktd2692 and ktd2801 are known to use this protocol.
  */
 
+#include <linux/bits.h>
 #include <linux/delay.h>
+#include <linux/export.h>
 #include <linux/gpio/consumer.h>
+#include <linux/types.h>
+
 #include <linux/leds-expresswire.h>
 
 void expresswire_power_off(struct expresswire_common_props *props)
include/linux/leds-expresswire.h +3 -1
index 3c61902ccac8..a422921f4159 100644
@@ -8,7 +8,9 @@
 #ifndef _LEDS_EXPRESSWIRE_H
 #define _LEDS_EXPRESSWIRE_H
 
-#include <linux/gpio/consumer.h>
+#include <linux/types.h>
+
+struct gpio_desc;
 
 struct expresswire_timing {
 	unsigned long poweroff_us;
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#1 lore raw

Hi!

Quoted 16 lines

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

---
v2: added one more missing header

 drivers/leds/leds-expresswire.c  | 4 ++++
 include/linux/leds-expresswire.h | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
include/linux/leds-expresswire.h +0 -0
index 3c61902ccac8..a422921f4159 100644

include/linux/leds-expresswire.h line 13

Quoted 7 lines
include/linux/leds-expresswire.h +3 -1
@@ -8,7 +8,9 @@
 #ifndef _LEDS_EXPRESSWIRE_H
 #define _LEDS_EXPRESSWIRE_H
 
-#include <linux/gpio/consumer.h>
+#include <linux/types.h>
+
+struct gpio_desc;

If include tweak means you need to declare struct, is it ian improvement?

BR,
Pavel

Signature · 1 line
People of Russia, stop Putin before his war on Ukraine escalates.
maintainer
#2 lore raw
Quoted 7 lines · Pavel Machek

include/linux/leds-expresswire.h line 13

Quoted 4 lines
include/linux/leds-expresswire.h +3 -1
-#include <linux/gpio/consumer.h>
+#include <linux/types.h>
+
+struct gpio_desc;

If include tweak means you need to declare struct, is it ian improvement?

In this case I'd say yes, the header in question has numerous other declarations (which are not used in leds-expresswire.h) and itself declares gpio_desc like this anyway.

Regards,
--
Duje

#3 lore raw
In reply to Pavel Machek

On Fri, Feb 23, 2024 at 09:56:56PM +0100, Pavel Machek wrote:

...

Quoted 4 lines
Quoted 1 line

+struct gpio_desc;

If include tweak means you need to declare struct, is it ian improvement?

Of course, we increase a build time by dropping the header that's not used for the compilation.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw
Quoted 1 line · Andy Shevchenko

On Fri, Feb 23, 2024 at 09:56:56PM +0100, Pavel Machek wrote:

...

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

+struct gpio_desc;

If include tweak means you need to declare struct, is it ian improvement?

Of course, we increase a build time by dropping the header that's

Should be read: increase --> decrease

Quoted 1 line

not used for the compilation.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw
Quoted 5 lines · Duje Mihanović
Quoted 2 lines · Andy Shevchenko

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

Thank you!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer Applied
#7 lore raw

Re: (subset) [PATCH v2 1/1] leds: expresswire: Don't use "proxy" headers

In reply to Andy Shevchenko
Quoted 4 lines · Andy Shevchenko

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

Applied, thanks!

[1/1] leds: expresswire: Don't use "proxy" headers

      commit: 8471d8737e3b4915ba0802985427364cd286ca5b

--
Lee Jones [李琼斯]