public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] EmulatorPkg/PlatformBmLib: Fix GCC build failure
@ 2018-09-03  2:24 Ruiyu Ni
  2018-09-03  7:09 ` Bi, Dandan
  0 siblings, 1 reply; 2+ messages in thread
From: Ruiyu Ni @ 2018-09-03  2:24 UTC (permalink / raw)
  To: edk2-devel; +Cc: Dandan Bi

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>
Cc: Dandan Bi <dandan.bi@intel.com>
---
 EmulatorPkg/Library/PlatformBmLib/PlatformBmMemoryTest.c | 14 --------------
 1 file changed, 14 deletions(-)

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



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

* Re: [PATCH] EmulatorPkg/PlatformBmLib: Fix GCC build failure
  2018-09-03  2:24 [PATCH] EmulatorPkg/PlatformBmLib: Fix GCC build failure Ruiyu Ni
@ 2018-09-03  7:09 ` Bi, Dandan
  0 siblings, 0 replies; 2+ messages in thread
From: Bi, Dandan @ 2018-09-03  7:09 UTC (permalink / raw)
  To: Ni, Ruiyu, edk2-devel@lists.01.org

Reviewed-by: Dandan Bi <dandan.bi@intel.com>


Thanks,
Dandan

-----Original Message-----
From: Ni, Ruiyu 
Sent: Monday, September 3, 2018 10:24 AM
To: edk2-devel@lists.01.org
Cc: Bi, Dandan <dandan.bi@intel.com>
Subject: [PATCH] EmulatorPkg/PlatformBmLib: Fix GCC build failure

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>
Cc: Dandan Bi <dandan.bi@intel.com>
---
 EmulatorPkg/Library/PlatformBmLib/PlatformBmMemoryTest.c | 14 --------------
 1 file changed, 14 deletions(-)

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



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

end of thread, other threads:[~2018-09-03  7:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-03  2:24 [PATCH] EmulatorPkg/PlatformBmLib: Fix GCC build failure Ruiyu Ni
2018-09-03  7:09 ` Bi, Dandan

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