Sfoglia il codice sorgente

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>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
Agyeman, Prince 4 anni fa
parent
commit
9cd22ae579

+ 9 - 0
Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c

@@ -348,6 +348,15 @@ 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 ();