Skip to contentSkip to conversation

auxdisplay: charlcd: Don't rebuild when CONFIG_PANEL_BOOT_MESSAGE=y

PATCH In review Andy Shevchenko 2 participants 3 messages Apr 9, 2024 – Apr 11, 2024 Auxiliary display drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 auxdisplay: charlcd: Don't rebuild when CONFIG_PANEL_BOOT_MESSAGE=y

When CONFIG_PANEL_BOOT_MESSAGE=y the module still includes the generated header and gets rebuilt even if it doesn't use anything from that header. Include generated header conditionally to avoid unnecessary rebuilds.

---
 drivers/auxdisplay/charlcd.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/auxdisplay/charlcd.c +2 -0
index 5df019720c56..bb9463814454 100644
@@ -17,7 +17,9 @@
 #include <linux/uaccess.h>
 #include <linux/workqueue.h>
 
+#ifndef CONFIG_PANEL_BOOT_MESSAGE
 #include <generated/utsrelease.h>
+#endif
 
 #include "charlcd.h"
 
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
reviewer Reviewed-by on v1 1/1
#1 lore raw

Hi Andy,

Quoted 6 lines · Andy Shevchenko

When CONFIG_PANEL_BOOT_MESSAGE=y the module still includes the generated header and gets rebuilt even if it doesn't use anything from that header. Include generated header conditionally to avoid unnecessary rebuilds.

Thanks for your patch!

drivers/auxdisplay/charlcd.c line 22

Quoted 9 lines
drivers/auxdisplay/charlcd.c +2 -0
@@ -17,7 +17,9 @@
 #include <linux/uaccess.h>
 #include <linux/workqueue.h>
 
+#ifndef CONFIG_PANEL_BOOT_MESSAGE
 #include <generated/utsrelease.h>
+#endif

Perhaps move the existing "#ifdef CONFIG_PANEL_BOOT_MESSAGE"-block up, and move the #include inside the #else branch?

drivers/auxdisplay/charlcd.c line 24

Quoted 2 lines
drivers/auxdisplay/charlcd.c +0 -0
 #include "charlcd.h"

Regardless

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#2 lore raw
Quoted 17 lines · Geert Uytterhoeven
Quoted 6 lines · Andy Shevchenko

When CONFIG_PANEL_BOOT_MESSAGE=y the module still includes the generated header and gets rebuilt even if it doesn't use anything from that header. Include generated header conditionally to avoid unnecessary rebuilds.

Thanks for your patch!

Quoted 6 lines
drivers/auxdisplay/charlcd.c +0 -0
@@ -17,7 +17,9 @@
 #include <linux/uaccess.h>
 #include <linux/workqueue.h>
 
Quoted 6 lines

drivers/auxdisplay/charlcd.c line 22

Quoted 3 lines
drivers/auxdisplay/charlcd.c +2 -0
+#ifndef CONFIG_PANEL_BOOT_MESSAGE
 #include <generated/utsrelease.h>
+#endif

Perhaps move the existing "#ifdef CONFIG_PANEL_BOOT_MESSAGE"-block up, and move the #include inside the #else branch?

I was thinking about it, but decided to group headers together.

Quoted 4 lines

drivers/auxdisplay/charlcd.c line 24

Quoted 1 line
drivers/auxdisplay/charlcd.c +0 -0
 #include "charlcd.h"

Regardless

Pushed to my review and testing queue, thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko