]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmulatorPkg/PlatformBmLib: Fix GCC build failure
authorRuiyu Ni <ruiyu.ni@intel.com>
Mon, 3 Sep 2018 02:22:56 +0000 (10:22 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Thu, 6 Sep 2018 06:43:17 +0000 (14:43 +0800)
Some local variables are initialized but never used.
GCC complains about that. The patch fixes this issue.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
EmulatorPkg/Library/PlatformBmLib/PlatformBmMemoryTest.c

index 5b3977645344d4f2473c306aeba83050c4101b50..b07226ffbdc1dc0975d60fb9193d3303e09ec310 100644 (file)
@@ -41,26 +41,15 @@ PlatformBootManagerMemoryTest (
   EFI_GENERIC_MEMORY_TEST_PROTOCOL  *GenMemoryTest;\r
   UINT64                            TestedMemorySize;\r
   UINT64                            TotalMemorySize;\r
-  UINT64                            PreviousValue;\r
   BOOLEAN                           ErrorOut;\r
   BOOLEAN                           TestAbort;\r
   EFI_INPUT_KEY                     Key;\r
-  CHAR16                            *StrTotalMemory;\r
-  CHAR16                            *Pos;\r
-  UINTN                             StrTotalMemorySize;\r
 \r
   ReturnStatus = EFI_SUCCESS;\r
   ZeroMem (&Key, sizeof (EFI_INPUT_KEY));\r
 \r
-  StrTotalMemorySize = 128;\r
-  Pos = AllocateZeroPool (StrTotalMemorySize);\r
-  ASSERT (Pos != NULL);\r
-\r
-  StrTotalMemory    = Pos;\r
-\r
   TestedMemorySize  = 0;\r
   TotalMemorySize   = 0;\r
-  PreviousValue     = 0;\r
   ErrorOut          = FALSE;\r
   TestAbort         = FALSE;\r
 \r
@@ -72,7 +61,6 @@ PlatformBootManagerMemoryTest (
                   (VOID **) &GenMemoryTest\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-    FreePool (Pos);\r
     return EFI_SUCCESS;\r
   }\r
 \r
@@ -89,7 +77,6 @@ PlatformBootManagerMemoryTest (
     // do the test, and then the status of EFI_NO_MEDIA will be returned by\r
     // "MemoryTestInit". So it does not need to test memory again, just return.\r
     //\r
-    FreePool (Pos);\r
     return EFI_SUCCESS;\r
   }\r
 \r
@@ -128,6 +115,5 @@ PlatformBootManagerMemoryTest (
 Done:\r
   DEBUG ((DEBUG_INFO, "%d bytes of system memory tested OK\r\n", TotalMemorySize));\r
 \r
-  FreePool (Pos);\r
   return ReturnStatus;\r
 }\r