public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] tools/mkeficapsule.c: fix DEBUG build
@ 2021-02-20 20:40 Klaus Heinrich Kiwi
  2021-02-22 19:26 ` Heinrich Schuchardt
  0 siblings, 1 reply; 3+ messages in thread
From: Klaus Heinrich Kiwi @ 2021-02-20 20:40 UTC (permalink / raw)
  To: u-boot

Fix a missing comma sign (,) from a printf(), that is only
reachable if DEBUG is defined, in which case the build fails with:

    tools/mkeficapsule.c:266:36: error: expected ?)? before ?bin?
      266 |  printf("\tbin: %s\n\ttype: %pUl\n" bin, guid);
          |                                    ^~~~
          |                                    )

Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
---
 tools/mkeficapsule.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c
index 162494907a..1613e74ca7 100644
--- a/tools/mkeficapsule.c
+++ b/tools/mkeficapsule.c
@@ -263,7 +263,7 @@ static int create_fwbin(char *path, char *bin, efi_guid_t *guid,
 
 #ifdef DEBUG
 	printf("For output: %s\n", path);
-	printf("\tbin: %s\n\ttype: %pUl\n" bin, guid);
+	printf("\tbin: %s\n\ttype: %pUl\n", bin, guid);
 	printf("\tindex: %ld\n\tinstance: %ld\n", index, instance);
 #endif
 
-- 
2.25.1

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

* [PATCH] tools/mkeficapsule.c: fix DEBUG build
  2021-02-20 20:40 [PATCH] tools/mkeficapsule.c: fix DEBUG build Klaus Heinrich Kiwi
@ 2021-02-22 19:26 ` Heinrich Schuchardt
  2021-02-22 19:36   ` Heinrich Schuchardt
  0 siblings, 1 reply; 3+ messages in thread
From: Heinrich Schuchardt @ 2021-02-22 19:26 UTC (permalink / raw)
  To: u-boot

On 2/20/21 9:40 PM, Klaus Heinrich Kiwi wrote:
> Fix a missing comma sign (,) from a printf(), that is only
> reachable if DEBUG is defined, in which case the build fails with:
>
>      tools/mkeficapsule.c:266:36: error: expected ?)? before ?bin?
>        266 |  printf("\tbin: %s\n\ttype: %pUl\n" bin, guid);
>            |                                    ^~~~
>            |                                    )
>
> Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
> ---
>   tools/mkeficapsule.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c
> index 162494907a..1613e74ca7 100644
> --- a/tools/mkeficapsule.c
> +++ b/tools/mkeficapsule.c
> @@ -263,7 +263,7 @@ static int create_fwbin(char *path, char *bin, efi_guid_t *guid,
>
>   #ifdef DEBUG

Thank you for pointing out the issue.

"#ifdef DEBUG printf()" is not how we want to add debug output in
U-Boot. Please, use log_debug() instead of the three printf() statements.

Add

     #define LOG_CATEGORY LOGC_EFI

before all includes.

Add

     #include <log.h>

in the includes section.

Please, add Alex and me to the next version of the patch.

Best regards

Heinrich

>   	printf("For output: %s\n", path);
> -	printf("\tbin: %s\n\ttype: %pUl\n" bin, guid);
> +	printf("\tbin: %s\n\ttype: %pUl\n", bin, guid);
>   	printf("\tindex: %ld\n\tinstance: %ld\n", index, instance);
>   #endif
>
>

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

* [PATCH] tools/mkeficapsule.c: fix DEBUG build
  2021-02-22 19:26 ` Heinrich Schuchardt
@ 2021-02-22 19:36   ` Heinrich Schuchardt
  0 siblings, 0 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2021-02-22 19:36 UTC (permalink / raw)
  To: u-boot

On 2/22/21 8:26 PM, Heinrich Schuchardt wrote:
> On 2/20/21 9:40 PM, Klaus Heinrich Kiwi wrote:
>> Fix a missing comma sign (,) from a printf(), that is only
>> reachable if DEBUG is defined, in which case the build fails with:
>>
>> ???? tools/mkeficapsule.c:266:36: error: expected ?)? before ?bin?
>> ?????? 266 |? printf("\tbin: %s\n\ttype: %pUl\n" bin, guid);
>> ?????????? |??????????????????????????????????? ^~~~
>> ?????????? |??????????????????????????????????? )
>>
>> Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
>> ---
>> ? tools/mkeficapsule.c | 2 +-
>> ? 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c
>> index 162494907a..1613e74ca7 100644
>> --- a/tools/mkeficapsule.c
>> +++ b/tools/mkeficapsule.c
>> @@ -263,7 +263,7 @@ static int create_fwbin(char *path, char *bin,
>> efi_guid_t *guid,
>>
>> ? #ifdef DEBUG
>
> Thank you for pointing out the issue.
>
> "#ifdef DEBUG printf()" is not how we want to add debug output in
> U-Boot. Please, use log_debug() instead of the three printf() statements.
>
> Add
>
>  ??? #define LOG_CATEGORY LOGC_EFI
>
> before all includes.
>
> Add
>
>  ??? #include <log.h>
>
> in the includes section.
>
> Please, add Alex and me to the next version of the patch.

Sorry, this is a Linux binary and not main U-Boot code.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

>
> Best regards
>
> Heinrich
>
>> ????? printf("For output: %s\n", path);
>> -??? printf("\tbin: %s\n\ttype: %pUl\n" bin, guid);
>> +??? printf("\tbin: %s\n\ttype: %pUl\n", bin, guid);
>> ????? printf("\tindex: %ld\n\tinstance: %ld\n", index, instance);
>> ? #endif
>>
>>
>

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

end of thread, other threads:[~2021-02-22 19:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-20 20:40 [PATCH] tools/mkeficapsule.c: fix DEBUG build Klaus Heinrich Kiwi
2021-02-22 19:26 ` Heinrich Schuchardt
2021-02-22 19:36   ` Heinrich Schuchardt

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