[PATCH 03/13] bootsource: stub out when in PBL

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Oct 16 02:01:40 PDT 2024


To optimize out calls to undefined functions in PBL at compile-time
instead of link time, let's use IS_PROPER instead of IS_ENABELED(),
so the remainder of the code is skipped in PBL build instead of relying
on linker garbage collection.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 common/bootsource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/bootsource.c b/common/bootsource.c
index 6808c9c51d88..ef90bd8d7dc4 100644
--- a/common/bootsource.c
+++ b/common/bootsource.c
@@ -158,7 +158,7 @@ int bootsource_of_alias_xlate(enum bootsource src, int instance)
 	struct device_node *np;
 	int alias_id;
 
-	if (!IS_ENABLED(CONFIG_OFDEVICE))
+	if (!IS_PROPER(CONFIG_OFDEVICE))
 		return BOOTSOURCE_INSTANCE_UNKNOWN;
 
 	if (src == BOOTSOURCE_UNKNOWN ||
-- 
2.39.5




More information about the barebox mailing list