Skip to contentSkip to conversation

boot/fit: print name of config node not found

PATCH Superseded Frank Wunderlich 2 participants 3 messages Jan 11 – Jan 15

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 boot/fit: print name of config node not found

From: Frank Wunderlich <[email protected]>

Show name of configuration node which was not found.

current state gives no hint if fit image is wrong or the requested name.

Could not find configuration node
load of <NULL> failed

After this patch we see name like this:

Could not find configuration node '#ov-test'
load of <NULL> failed

---
 boot/image-fit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/image-fit.c +1 -1
index 2d040e38d97b..92675e98f2eb 100644
@@ -2125,7 +2125,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr,
 		if (ret < 0 && ret != -EINVAL)
 			ret = fit_conf_get_node(fit, fit_uname_config);
 		if (ret < 0) {
-			puts("Could not find configuration node\n");
+			printf("Could not find configuration node '%s'\n", fit_uname_config);
 			bootstage_error(bootstage_id +
 					BOOTSTAGE_SUB_NO_UNIT_NAME);
 			return -ENOENT;
Signature · 1 line
2.43.0
#1 lore raw

Hi Frank,

Quoted 24 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Show name of configuration node which was not found.

current state gives no hint if fit image is wrong or the requested name.

Could not find configuration node
load of <NULL> failed

After this patch we see name like this:

Could not find configuration node '#ov-test'
load of <NULL> failed

---
  boot/image-fit.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
boot/image-fit.c +0 -0
index 2d040e38d97b..92675e98f2eb 100644

boot/image-fit.c int fit_image_load(struct bootm_headers *images, ulong addr, · line 2128

Quoted 5 lines
boot/image-fit.c +1 -1
@@ -2125,7 +2125,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr,
  		if (ret < 0 && ret != -EINVAL)
  			ret = fit_conf_get_node(fit, fit_uname_config);
  		if (ret < 0) {
-			puts("Could not find configuration node\n");
+			printf("Could not find configuration node '%s'\n", fit_uname_config);

It seems like fit_uname_config can be NULL (see outside of the patch context). How does printf behave when this is the case? Should we do something like

fit_uname_config ?: ''

instead? That does seem like the message could be confusing also as now it says "Could not find configuration node ''".

Cheers,
Quentin

#2 lore raw

Hi

Am 15. Januar 2026 13:36:15 MEZ schrieb Quentin Schulz <[email protected]>:

Quoted 35 lines

Hi Frank,

Quoted 24 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Show name of configuration node which was not found.

current state gives no hint if fit image is wrong or the requested name.

Could not find configuration node
load of <NULL> failed

After this patch we see name like this:

Could not find configuration node '#ov-test'
load of <NULL> failed

---
  boot/image-fit.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
boot/image-fit.c +0 -0
index 2d040e38d97b..92675e98f2eb 100644

boot/image-fit.c int fit_image_load(struct bootm_headers *images, ulong addr, · line 2128

Quoted 5 lines
boot/image-fit.c +1 -1
@@ -2125,7 +2125,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr,
  		if (ret < 0 && ret != -EINVAL)
  			ret = fit_conf_get_node(fit, fit_uname_config);
  		if (ret < 0) {
-			puts("Could not find configuration node\n");
+			printf("Could not find configuration node '%s'\n", fit_uname_config);

It seems like fit_uname_config can be NULL (see outside of the patch context). How does printf behave when this is the case? Should we do something like

Quoted 3 lines

fit_uname_config ?: ''

instead? That does seem like the message could be confusing also as now it says "Could not find configuration node ''".

Thank you for taking a look.
In my current testcase it was an empty string, but yes I could do something like you suggested...maybe call it "null" or "empty" instead of empty string?

Quoted 2 lines

Cheers,
Quentin

regards Frank