public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms] [PATCH] SimicsOpenBoardPkg: Fix gcc build failure
@ 2019-10-30 17:04 Agyeman, Prince
  2019-10-31  1:33 ` Nate DeSimone
  2019-10-31  7:10 ` Kubacki, Michael A
  0 siblings, 2 replies; 3+ messages in thread
From: Agyeman, Prince @ 2019-10-30 17:04 UTC (permalink / raw)
  To: devel; +Cc: Ankit Sinha, Nate DeSimone, Kubacki Michael A

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2225

Currently, gcc 5 encounters an error "unused-but-set-variable" in
BdsPlatform.c  as a result of a Status variable not being used
after it's set.

This was fixed by printing the Status variable when
EfiBootManagerDeleteLoadOptionVariable function encounters an error

Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Kubacki Michael A <michael.a.kubacki@intel.com>

Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
---
 .../Library/PlatformBootManagerLib/BdsPlatform.c              | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index 7aa3860f75..a4b010be63 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -348,6 +348,10 @@ PlatformBootManagerBeforeConsole (
   NvBootOptions = EfiBootManagerGetLoadOptions (&NvBootOptionCount, LoadOptionTypeBoot);
   for (Index = 0; Index < NvBootOptionCount; Index++) {
     Status = EfiBootManagerDeleteLoadOptionVariable (NvBootOptions[Index].OptionNumber, LoadOptionTypeBoot);
+    if(EFI_ERROR (Status)){
+      DEBUG ((DEBUG_ERROR,
+          "%a: removing Boot#%04x %r\n", __FUNCTION__, (UINT32)NvBootOptions[Index].OptionNumber, Status));
+    }
   }
 
   InstallDevicePathCallback ();
-- 
2.19.1.windows.1


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

* Re: [edk2-platforms] [PATCH] SimicsOpenBoardPkg: Fix gcc build failure
  2019-10-30 17:04 [edk2-platforms] [PATCH] SimicsOpenBoardPkg: Fix gcc build failure Agyeman, Prince
@ 2019-10-31  1:33 ` Nate DeSimone
  2019-10-31  7:10 ` Kubacki, Michael A
  1 sibling, 0 replies; 3+ messages in thread
From: Nate DeSimone @ 2019-10-31  1:33 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Sinha, Ankit, Kubacki, Michael A

Your whitespace doesn't quite match edk2 coding style guidelines, but we can fix that during commit.

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Agyeman, Prince <prince.agyeman@intel.com> 
Sent: Wednesday, October 30, 2019 10:05 AM
To: devel@edk2.groups.io
Cc: Sinha, Ankit <ankit.sinha@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Kubacki, Michael A <michael.a.kubacki@intel.com>
Subject: [edk2-platforms] [PATCH] SimicsOpenBoardPkg: Fix gcc build failure

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2225

Currently, gcc 5 encounters an error "unused-but-set-variable" in BdsPlatform.c  as a result of a Status variable not being used after it's set.

This was fixed by printing the Status variable when EfiBootManagerDeleteLoadOptionVariable function encounters an error

Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Kubacki Michael A <michael.a.kubacki@intel.com>

Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
---
 .../Library/PlatformBootManagerLib/BdsPlatform.c              | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index 7aa3860f75..a4b010be63 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/B
+++ dsPlatform.c
@@ -348,6 +348,10 @@ PlatformBootManagerBeforeConsole (
   NvBootOptions = EfiBootManagerGetLoadOptions (&NvBootOptionCount, LoadOptionTypeBoot);
   for (Index = 0; Index < NvBootOptionCount; Index++) {
     Status = EfiBootManagerDeleteLoadOptionVariable (NvBootOptions[Index].OptionNumber, LoadOptionTypeBoot);
+    if(EFI_ERROR (Status)){
+      DEBUG ((DEBUG_ERROR,
+          "%a: removing Boot#%04x %r\n", __FUNCTION__, (UINT32)NvBootOptions[Index].OptionNumber, Status));
+    }
   }
 
   InstallDevicePathCallback ();
--
2.19.1.windows.1


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

* Re: [edk2-platforms] [PATCH] SimicsOpenBoardPkg: Fix gcc build failure
  2019-10-30 17:04 [edk2-platforms] [PATCH] SimicsOpenBoardPkg: Fix gcc build failure Agyeman, Prince
  2019-10-31  1:33 ` Nate DeSimone
@ 2019-10-31  7:10 ` Kubacki, Michael A
  1 sibling, 0 replies; 3+ messages in thread
From: Kubacki, Michael A @ 2019-10-31  7:10 UTC (permalink / raw)
  To: Agyeman, Prince, devel@edk2.groups.io; +Cc: Sinha, Ankit, Desimone, Nathaniel L

Please check whitespace and formatting in the future. I agree with Nate
that it can be fixed when pushed but there's quite a few errors here.

Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>

> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Wednesday, October 30, 2019 10:05 AM
> To: devel@edk2.groups.io
> Cc: Sinha, Ankit <ankit.sinha@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Kubacki, Michael A
> <michael.a.kubacki@intel.com>
> Subject: [edk2-platforms] [PATCH] SimicsOpenBoardPkg: Fix gcc build failure
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2225
> 
> Currently, gcc 5 encounters an error "unused-but-set-variable" in
> BdsPlatform.c  as a result of a Status variable not being used after it's set.
> 
> This was fixed by printing the Status variable when
> EfiBootManagerDeleteLoadOptionVariable function encounters an error
> 
> Cc: Ankit Sinha <ankit.sinha@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Kubacki Michael A <michael.a.kubacki@intel.com>
> 
> Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
> ---
>  .../Library/PlatformBootManagerLib/BdsPlatform.c              | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/Bds
> Platform.c
> b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/Bd
> sPlatform.c
> index 7aa3860f75..a4b010be63 100644
> ---
> a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/Bds
> Platform.c
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/B
> +++ dsPlatform.c
> @@ -348,6 +348,10 @@ PlatformBootManagerBeforeConsole (
>    NvBootOptions = EfiBootManagerGetLoadOptions (&NvBootOptionCount,
> LoadOptionTypeBoot);
>    for (Index = 0; Index < NvBootOptionCount; Index++) {
>      Status = EfiBootManagerDeleteLoadOptionVariable
> (NvBootOptions[Index].OptionNumber, LoadOptionTypeBoot);
> +    if(EFI_ERROR (Status)){
> +      DEBUG ((DEBUG_ERROR,
> +          "%a: removing Boot#%04x %r\n", __FUNCTION__,
> (UINT32)NvBootOptions[Index].OptionNumber, Status));
> +    }
>    }
> 
>    InstallDevicePathCallback ();
> --
> 2.19.1.windows.1


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

end of thread, other threads:[~2019-10-31  7:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-30 17:04 [edk2-platforms] [PATCH] SimicsOpenBoardPkg: Fix gcc build failure Agyeman, Prince
2019-10-31  1:33 ` Nate DeSimone
2019-10-31  7:10 ` Kubacki, Michael A

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