[PATCH] logo: spell out CONFIG_ options for fixdep
Ahmad Fatoum
a.fatoum at barebox.org
Sun Jun 1 23:02:45 PDT 2025
To avoid rebuilding nearly the whole project when a header changes,
fixdep collects referenced CONFIG_ symbols in every file and prunes the
dependency list accordingly. This only works when we don't hide CONFIG_
symbols with preprocessor text substitution shenanigans.
logo.c does just that triggering a compile failure, when logos are
removed in config without touching the file. Spell out the config
symbols to fix this.
This is the only instance currently of /CONFIG_.*##/, so I believe we
don't have this bug elsewhere.
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
lib/logo/logo.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/lib/logo/logo.c b/lib/logo/logo.c
index a64f489939eb..b8f7ae028e83 100644
--- a/lib/logo/logo.c
+++ b/lib/logo/logo.c
@@ -20,10 +20,8 @@
extern char __bblogo_barebox_logo_w##width##_start[]; \
extern char __bblogo_barebox_logo_w##width##_end[]; \
\
- static void load_logo_##width(void) \
+ static __maybe_unused void load_logo_##width(void) \
{ \
- if (!IS_ENABLED(CONFIG_BAREBOX_LOGO_##width)) \
- return; \
load_logo(width, __bblogo_barebox_logo_w##width##_start, \
__bblogo_barebox_logo_w##width##_end); \
}
@@ -60,11 +58,15 @@ static int logo_init(void)
if (ret)
return ret;
- load_logo_64();
- load_logo_240();
- load_logo_320();
- load_logo_400();
- load_logo_640();
+ /*
+ * fixdep depends on CONFIG_ symbols being listed in the file
+ * as-is with no preprocessor magic involved
+ */
+ IF_ENABLED(CONFIG_BAREBOX_LOGO_64, load_logo_64());
+ IF_ENABLED(CONFIG_BAREBOX_LOGO_240, load_logo_240());
+ IF_ENABLED(CONFIG_BAREBOX_LOGO_320, load_logo_320());
+ IF_ENABLED(CONFIG_BAREBOX_LOGO_400, load_logo_400());
+ IF_ENABLED(CONFIG_BAREBOX_LOGO_640, load_logo_640());
return 0;
}
--
2.39.5
More information about the barebox
mailing list