From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: Two or more type TXT spf records found.) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C9637210FCF5C for ; Sun, 2 Sep 2018 19:23:20 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Sep 2018 19:23:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,323,1531810800"; d="scan'208";a="229685815" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.8]) by orsmga004.jf.intel.com with ESMTP; 02 Sep 2018 19:23:19 -0700 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Dandan Bi Date: Mon, 3 Sep 2018 10:24:06 +0800 Message-Id: <20180903022406.25580-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 Subject: [PATCH] EmulatorPkg/PlatformBmLib: Fix GCC build failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2018 02:23:21 -0000 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 Cc: Dandan Bi --- 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