public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cmd: efidebug: fix a build error in show_efi_boot_opt()
@ 2019-11-26  0:57 AKASHI Takahiro
  2019-11-26  1:01 ` Heinrich Schuchardt
  0 siblings, 1 reply; 3+ messages in thread
From: AKASHI Takahiro @ 2019-11-26  0:57 UTC (permalink / raw)
  To: u-boot

I detected the following error in sandbox with Clang on Travis CI:
    +cmd/efidebug.c:703:15: error: result of comparison of constant
     9223372036854775822 with expression of type 'int' is always false
     [-Werror,-Wtautological-constant-out-of-range-compare]
    +        else if (ret == EFI_NOT_FOUND)
    +                 ~~~ ^  ~~~~~~~~~~~~~

Simply changing a type of 'ret' to efi_status_t will fix this error.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 cmd/efidebug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/efidebug.c b/cmd/efidebug.c
index ef97e19d0735..09ac84e5ef0a 100644
--- a/cmd/efidebug.c
+++ b/cmd/efidebug.c
@@ -684,7 +684,7 @@ static void show_efi_boot_opt(int id)
 	efi_guid_t guid;
 	void *data = NULL;
 	efi_uintn_t size;
-	int ret;
+	efi_status_t ret;
 
 	sprintf(var_name, "Boot%04X", id);
 	p = var_name16;
-- 
2.24.0

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

* [U-Boot] [PATCH] cmd: efidebug: fix a build error in show_efi_boot_opt()
  2019-11-26  0:57 [U-Boot] [PATCH] cmd: efidebug: fix a build error in show_efi_boot_opt() AKASHI Takahiro
@ 2019-11-26  1:01 ` Heinrich Schuchardt
  2019-11-26  1:10   ` AKASHI Takahiro
  0 siblings, 1 reply; 3+ messages in thread
From: Heinrich Schuchardt @ 2019-11-26  1:01 UTC (permalink / raw)
  To: u-boot

On 11/26/19 1:57 AM, AKASHI Takahiro wrote:
> I detected the following error in sandbox with Clang on Travis CI:
>      +cmd/efidebug.c:703:15: error: result of comparison of constant
>       9223372036854775822 with expression of type 'int' is always false
>       [-Werror,-Wtautological-constant-out-of-range-compare]
>      +        else if (ret == EFI_NOT_FOUND)
>      +                 ~~~ ^  ~~~~~~~~~~~~~
>
> Simply changing a type of 'ret' to efi_status_t will fix this error.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> ---
>   cmd/efidebug.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cmd/efidebug.c b/cmd/efidebug.c
> index ef97e19d0735..09ac84e5ef0a 100644
> --- a/cmd/efidebug.c
> +++ b/cmd/efidebug.c
> @@ -684,7 +684,7 @@ static void show_efi_boot_opt(int id)
>   	efi_guid_t guid;
>   	void *data = NULL;
>   	efi_uintn_t size;
> -	int ret;
> +	efi_status_t ret;
>
>   	sprintf(var_name, "Boot%04X", id);
>   	p = var_name16;
>

Thanks for reporting this issue.

Please, adjust this line too:

if (ret == (int)EFI_BUFFER_TOO_SMALL) {

Best regards

Heinrich

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

* [U-Boot] [PATCH] cmd: efidebug: fix a build error in show_efi_boot_opt()
  2019-11-26  1:01 ` Heinrich Schuchardt
@ 2019-11-26  1:10   ` AKASHI Takahiro
  0 siblings, 0 replies; 3+ messages in thread
From: AKASHI Takahiro @ 2019-11-26  1:10 UTC (permalink / raw)
  To: u-boot

On Tue, Nov 26, 2019 at 02:01:53AM +0100, Heinrich Schuchardt wrote:
> On 11/26/19 1:57 AM, AKASHI Takahiro wrote:
> >I detected the following error in sandbox with Clang on Travis CI:
> >     +cmd/efidebug.c:703:15: error: result of comparison of constant
> >      9223372036854775822 with expression of type 'int' is always false
> >      [-Werror,-Wtautological-constant-out-of-range-compare]
> >     +        else if (ret == EFI_NOT_FOUND)
> >     +                 ~~~ ^  ~~~~~~~~~~~~~
> >
> >Simply changing a type of 'ret' to efi_status_t will fix this error.
> >
> >Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> >---
> >  cmd/efidebug.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/cmd/efidebug.c b/cmd/efidebug.c
> >index ef97e19d0735..09ac84e5ef0a 100644
> >--- a/cmd/efidebug.c
> >+++ b/cmd/efidebug.c
> >@@ -684,7 +684,7 @@ static void show_efi_boot_opt(int id)
> >  	efi_guid_t guid;
> >  	void *data = NULL;
> >  	efi_uintn_t size;
> >-	int ret;
> >+	efi_status_t ret;
> >
> >  	sprintf(var_name, "Boot%04X", id);
> >  	p = var_name16;
> >
> 
> Thanks for reporting this issue.
> 
> Please, adjust this line too:
> 
> if (ret == (int)EFI_BUFFER_TOO_SMALL) {

Sure.
-Takahiro Akashi

> Best regards
> 
> Heinrich

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

end of thread, other threads:[~2019-11-26  1:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-26  0:57 [U-Boot] [PATCH] cmd: efidebug: fix a build error in show_efi_boot_opt() AKASHI Takahiro
2019-11-26  1:01 ` Heinrich Schuchardt
2019-11-26  1:10   ` AKASHI Takahiro

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