public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] boot/fit: print name of config node not found
@ 2026-01-11  9:23 Frank Wunderlich
  2026-01-15 12:36 ` Quentin Schulz
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Wunderlich @ 2026-01-11  9:23 UTC (permalink / raw)
  To: Tom Rini, u-boot; +Cc: Frank Wunderlich

From: Frank Wunderlich <frank-w@public-files.de>

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

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 boot/image-fit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boot/image-fit.c b/boot/image-fit.c
index 2d040e38d97b..92675e98f2eb 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -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;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] boot/fit: print name of config node not found
  2026-01-11  9:23 [PATCH] boot/fit: print name of config node not found Frank Wunderlich
@ 2026-01-15 12:36 ` Quentin Schulz
  2026-01-15 15:25   ` Frank Wunderlich
  0 siblings, 1 reply; 3+ messages in thread
From: Quentin Schulz @ 2026-01-15 12:36 UTC (permalink / raw)
  To: Frank Wunderlich, Tom Rini, u-boot; +Cc: Frank Wunderlich

Hi Frank,

On 1/11/26 10:23 AM, Frank Wunderlich wrote:
> From: Frank Wunderlich <frank-w@public-files.de>
> 
> 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
> 
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> ---
>   boot/image-fit.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/boot/image-fit.c b/boot/image-fit.c
> index 2d040e38d97b..92675e98f2eb 100644
> --- a/boot/image-fit.c
> +++ b/boot/image-fit.c
> @@ -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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] boot/fit: print name of config node not found
  2026-01-15 12:36 ` Quentin Schulz
@ 2026-01-15 15:25   ` Frank Wunderlich
  0 siblings, 0 replies; 3+ messages in thread
From: Frank Wunderlich @ 2026-01-15 15:25 UTC (permalink / raw)
  To: Quentin Schulz, Tom Rini, u-boot; +Cc: Frank Wunderlich

Hi

Am 15. Januar 2026 13:36:15 MEZ schrieb Quentin Schulz <quentin.schulz@cherry.de>:
>Hi Frank,
>
>On 1/11/26 10:23 AM, Frank Wunderlich wrote:
>> From: Frank Wunderlich <frank-w@public-files.de>
>> 
>> 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
>> 
>> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
>> ---
>>   boot/image-fit.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/boot/image-fit.c b/boot/image-fit.c
>> index 2d040e38d97b..92675e98f2eb 100644
>> --- a/boot/image-fit.c
>> +++ b/boot/image-fit.c
>> @@ -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 ''".

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?

>Cheers,
>Quentin


regards Frank

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-15 15:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-11  9:23 [PATCH] boot/fit: print name of config node not found Frank Wunderlich
2026-01-15 12:36 ` Quentin Schulz
2026-01-15 15:25   ` Frank Wunderlich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox