public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Gary Lin <glin@suse.com>
To: edk2-devel@lists.01.org
Cc: David Wei <david.wei@intel.com>
Subject: [PATCH v2 13/19] Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the unused variables
Date: Fri, 29 Jul 2016 11:25:32 +0800	[thread overview]
Message-ID: <20160729032538.17730-14-glin@suse.com> (raw)
In-Reply-To: <20160729032538.17730-1-glin@suse.com>

Fix the following errors from gcc:

Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c: In function ‘PrepareSetupInformation’:
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:540:31: error: variable ‘EeState’ set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:532:31: error: variable ‘SrcDataSize’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c: In function ‘UpdateAdditionalInformation’:
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:818:35: error: variable ‘Size’ set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:817:36: error: variable ‘SystemManufacturer’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c: In function ‘JudgeHandleIsPCIDevice’:
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:1094:22: error: variable ‘DevicePath’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c: In function ‘GetChipsetSataPortSpeed’:
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:1470:31: error: variable ‘DwordReg’ set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:1469:31: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
 .../PlatformSetupDxe/SetupInfoRecords.c            | 41 +++++++---------------
 1 file changed, 13 insertions(+), 28 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c b/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c
index c7f85b9..8979b41 100644
--- a/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c
+++ b/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c
@@ -521,7 +521,6 @@ PrepareSetupInformation (
   EFI_DATA_HUB_PROTOCOL       *DataHub;
   EFI_DATA_RECORD_HEADER      *Record;
   UINT8                       *SrcData;
-  UINT32                      SrcDataSize;
   EFI_SUBCLASS_TYPE1_HEADER   *DataHeader;
   CHAR16                      *NewString;
   CHAR16                      *NewString2;
@@ -529,7 +528,6 @@ PrepareSetupInformation (
   STRING_REF                  TokenToUpdate;
   EFI_PROCESSOR_VERSION_DATA  *ProcessorVersion;
   UINTN                       Index;
-  UINT16                      EeState;
   UINTN                       DataOutput;
 
   EFI_PROCESSOR_MICROCODE_REVISION_DATA   *CpuUcodeRevisionData;
@@ -548,11 +546,6 @@ PrepareSetupInformation (
   SetMem(ReleaseTime, sizeof(ReleaseTime), 0);
 
   //
-  // Initialize EE state for not to show EE related setup options
-  //
-  EeState = 0;
-
-  //
   // Get the Data Hub Protocol. Assume only one instance
   //
   Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, (void **)&DataHub);
@@ -570,7 +563,6 @@ PrepareSetupInformation (
       if (Record->DataRecordClass == EFI_DATA_RECORD_CLASS_DATA) {
         DataHeader  = (EFI_SUBCLASS_TYPE1_HEADER *)(Record + 1);
         SrcData     = (UINT8  *)(DataHeader + 1);
-        SrcDataSize = Record->RecordSize - Record->HeaderSize - sizeof (EFI_SUBCLASS_TYPE1_HEADER);
 
         //
         // Processor
@@ -806,8 +798,6 @@ UpdateAdditionalInformation (
   EFI_DATA_HUB_PROTOCOL           *DataHub;
   EFI_DATA_RECORD_HEADER          *Record;
   EFI_SUBCLASS_TYPE1_HEADER       *DataHeader;
-  EFI_MISC_SYSTEM_MANUFACTURER    *SystemManufacturer;
-  UINTN                           Size;
   EFI_SMBIOS_PROTOCOL             *Smbios;
   EFI_SMBIOS_HANDLE               SmbiosHandle;
   EFI_SMBIOS_TABLE_HEADER         *SmbiosRecord;
@@ -817,6 +807,9 @@ UpdateAdditionalInformation (
   CHAR16                          *IfwiVersion = NULL;
   UINT16                          SearchIndex;
   EFI_STRING_ID                   TokenToUpdate;
+#if defined( RVP_SUPPORT ) && RVP_SUPPORT
+  EFI_MISC_SYSTEM_MANUFACTURER    *SystemManufacturer;
+#endif
 
   Status = gBS->LocateProtocol (
                   &gEfiDataHubProtocolGuid,
@@ -826,8 +819,6 @@ UpdateAdditionalInformation (
 
   ASSERT_EFI_ERROR(Status);
 
-  Size = 3;
-
   MonotonicCount  = 0;
   Record = NULL;
   do {
@@ -842,12 +833,12 @@ UpdateAdditionalInformation (
 
       if (CompareGuid(&Record->DataRecordGuid, &gEfiMiscSubClassGuid) &&
           (DataHeader->RecordType == EFI_MISC_SYSTEM_MANUFACTURER_RECORD_NUMBER)) {
+#if defined( RVP_SUPPORT ) && RVP_SUPPORT
         //
         // System Information
         //
         SystemManufacturer = (EFI_MISC_SYSTEM_MANUFACTURER *)(DataHeader + 1);
 
-#if defined( RVP_SUPPORT ) && RVP_SUPPORT
         //
         // UUID  (System Information)
         //
@@ -1083,7 +1074,6 @@ JudgeHandleIsPCIDevice(
 {
   EFI_STATUS  Status;
   EFI_DEVICE_PATH   *DPath;
-  EFI_DEVICE_PATH   *DevicePath;
 
   Status = gBS->HandleProtocol (
                   Handle,
@@ -1092,7 +1082,6 @@ JudgeHandleIsPCIDevice(
                   );
   if(!EFI_ERROR(Status))
   {
-    DevicePath = DPath;
     while(!IsDevicePathEnd(DPath))
     {
       if((DPath->Type == HARDWARE_DEVICE_PATH) && (DPath->SubType == HW_PCI_DP))
@@ -1458,9 +1447,6 @@ GetChipsetSataPortSpeed (
   UINT32                      IdeAhciBar;
   EFI_PHYSICAL_ADDRESS        MemBaseAddress = 0;
   UINT8                       FunNum;
-  EFI_STATUS                  Status;
-  UINT32                      DwordReg;
-
 
   DeviceSpeed = 0x01; // generation 1
 
@@ -1470,15 +1456,15 @@ GetChipsetSataPortSpeed (
   //
     FunNum = PCI_FUNCTION_NUMBER_PCH_SATA;
     MemBaseAddress = 0x0ffffffff;
-    Status = gDS->AllocateMemorySpace (
-                    EfiGcdAllocateMaxAddressSearchBottomUp,
-                    EfiGcdMemoryTypeMemoryMappedIo,
-                    N_PCH_SATA_ABAR_ALIGNMENT,  // 2^11: 2K Alignment
-                    V_PCH_SATA_ABAR_LENGTH,     // 2K Length
-                    &MemBaseAddress,
-                    mImageHandle,
-                    NULL
-                    );
+    gDS->AllocateMemorySpace (
+           EfiGcdAllocateMaxAddressSearchBottomUp,
+           EfiGcdMemoryTypeMemoryMappedIo,
+           N_PCH_SATA_ABAR_ALIGNMENT,  // 2^11: 2K Alignment
+           V_PCH_SATA_ABAR_LENGTH,     // 2K Length
+           &MemBaseAddress,
+           mImageHandle,
+           NULL
+           );
     IdeAhciBar = MmioRead32 (
                    MmPciAddress (
 				     0,
@@ -1508,7 +1494,6 @@ GetChipsetSataPortSpeed (
       // Program the "Ports Implemented Register"
       //
       MmioAndThenOr32 (IdeAhciBar + R_PCH_SATA_AHCI_PI, (UINT32)~(B_PCH_SATA_PORT0_IMPLEMENTED + B_PCH_SATA_PORT1_IMPLEMENTED), (UINT32)(B_PCH_SATA_PORT0_IMPLEMENTED + B_PCH_SATA_PORT1_IMPLEMENTED));
-      DwordReg = MmioRead32 (IdeAhciBar + R_PCH_SATA_AHCI_PI);
     }
 
     switch (PortNum)
-- 
2.9.2



  parent reply	other threads:[~2016-07-29  3:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
2016-07-29  3:25 ` [PATCH v2 01/19] Vlv2TbltDevicePkg: Amend the build script Gary Lin
2016-07-29  3:25 ` [PATCH v2 02/19] Vlv2TbltDevicePkg: Only define MDEPKG_NDEBUG for gcc release build Gary Lin
2016-07-29  7:42   ` Laszlo Ersek
2016-07-29  3:25 ` [PATCH v2 03/19] Vlv2TbltDevicePkg/MultiPlatformLib: Remove the unused variables Gary Lin
2016-07-29  3:25 ` [PATCH v2 04/19] Vlv2TbltDevicePkg/PlatformPei: Remove the unused variable Gary Lin
2016-07-29  3:25 ` [PATCH v2 05/19] Vlv2TbltDevicePkg/PlatformBdsLib: " Gary Lin
2016-07-29  3:25 ` [PATCH v2 06/19] Vlv2TbltDevicePkg/PlatformInitPei: Remove the unused variables Gary Lin
2016-07-29  3:25 ` [PATCH v2 07/19] Vlv2TbltDevicePkg/PlatformInitPei: Suppress the gcc error message Gary Lin
2016-07-29  3:25 ` [PATCH v2 08/19] Vlv2TbltDevicePkg/AcpiPlatform: Remove unused variables Gary Lin
2016-07-29  3:25 ` [PATCH v2 09/19] Vlv2TbltDevicePkg/AcpiPlatform: Amend the declaration of mGlobalNvsArea Gary Lin
2016-07-29  3:25 ` [PATCH v2 10/19] Vlv2TbltDevicePkg/PlatformGopPolicy: include UefiBootServicesTableLib.h Gary Lin
2016-07-29  3:25 ` [PATCH v2 11/19] Vlv2DeviceRefCodePkg/ValleyView2Soc: Remove the unused code Gary Lin
2016-07-29  3:25 ` [PATCH v2 12/19] Vlv2TbltDevicePkg/FvbRuntimeDxe: Remove unused variables Gary Lin
2016-07-29  3:25 ` Gary Lin [this message]
2016-07-29  3:25 ` [PATCH v2 14/19] Vlv2TbltDevicePkg/VlvPlatformInitDxe: " Gary Lin
2016-07-29  3:25 ` [PATCH v2 15/19] Vlv2TbltDevicePkg/PlatformDxe: Remove the " Gary Lin
2016-07-29  3:25 ` [PATCH v2 16/19] Vlv2TbltDevicePkg/Wpce791: Remove the unused variable Gary Lin
2016-07-29  3:25 ` [PATCH v2 17/19] Vlv2TbltDevicePkg/SmBiosMiscDxe: Remove unused variables Gary Lin
2016-07-29  3:25 ` [PATCH v2 18/19] Vlv2TbltDevicePkg/PpmPolicy: Remove the usage of global variables Gary Lin
2016-07-29  3:25 ` [PATCH v2 19/19] Vlv2TbltDevicePkg/PpmPolicy: Remove the unused variable Gary Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160729032538.17730-14-glin@suse.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox