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 15/19] Vlv2TbltDevicePkg/PlatformDxe: Remove the unused variables
Date: Fri, 29 Jul 2016 11:25:34 +0800	[thread overview]
Message-ID: <20160729032538.17730-16-glin@suse.com> (raw)
In-Reply-To: <20160729032538.17730-1-glin@suse.com>

Fix the following errors from gcc:

Vlv2TbltDevicePkg/PlatformDxe/Platform.c: In function ‘InitPciDevPME’:
Vlv2TbltDevicePkg/PlatformDxe/Platform.c:516:26: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformDxe/Platform.c: In function ‘InitThermalZone’:
Vlv2TbltDevicePkg/PlatformDxe/Platform.c:575:26: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c: In function ‘InitializeSubsystemIds’:
Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c:111:10: error: variable ‘SubsystemAudioVidDid’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c: In function ‘InitBadBars’:
Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c:115:40: error: variable ‘PciIoDevice’ set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c:114:39: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c: In function ‘ProgramPciLatency’:
Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c:320:39: 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>
Reviewed-by: David Wei <david.wei@intel.com>
---
 Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c |   2 -
 Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c   | 214 ++++++++++++++--------------
 Vlv2TbltDevicePkg/PlatformDxe/Platform.c    |  40 +++---
 3 files changed, 123 insertions(+), 133 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c b/Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c
index 06d325c..4569ce5 100644
--- a/Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c
+++ b/Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c
@@ -99,10 +99,8 @@ InitializeSubsystemIds (
 
   EFI_REG_TABLE *RegTablePtr;
   UINT32 SubsystemVidDid;
-  UINT32 SubsystemAudioVidDid;
 
   SubsystemVidDid = mPlatformInfo.SsidSvid;
-  SubsystemAudioVidDid = mPlatformInfo.SsidSvid;
 
   RegTablePtr = mSubsystemIdRegs;
 
diff --git a/Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c b/Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c
index 16aaa18..8c2bfff 100644
--- a/Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c
+++ b/Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c
@@ -102,8 +102,6 @@ InitBadBars(
   )
 {
 
-  EFI_STATUS                          Status;
-  PCI_IO_DEVICE                       *PciIoDevice;
   UINT64                              BaseAddress = 0;
   UINT64                              TempBaseAddress = 0;
   UINT8                               RevId = 0;
@@ -112,8 +110,6 @@ InitBadBars(
   UINT64                              MemSize;
   UINTN                               MemSizeBits;
 
-
-  PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (PciIo);
   switch ( VendorId) {
     case ATI_VENDOR_ID:
       //
@@ -124,31 +120,31 @@ InitBadBars(
       //
       // Get original BAR address
       //
-      Status = PciIo->Pci.Read (
-                            PciIo,
-                            EfiPciIoWidthUint32,
-                            Bar,
-                            1,
-                                (VOID *) &BaseAddress
-                            );
+      PciIo->Pci.Read (
+                   PciIo,
+                   EfiPciIoWidthUint32,
+                   Bar,
+                   1,
+                       (VOID *) &BaseAddress
+                   );
       //
       // Find BAR size
       //
       TempBaseAddress = 0xffffffff;
-      Status = PciIo->Pci.Write (
-                            PciIo,
-                            EfiPciIoWidthUint32,
-                            Bar,
-                            1,
-                                 (VOID *) &TempBaseAddress
-                            );
-      Status = PciIo->Pci.Read (
-                            PciIo,
-                            EfiPciIoWidthUint32,
-                            Bar,
-                            1,
-                                (VOID *) &TempBaseAddress
-                            );
+      PciIo->Pci.Write (
+                   PciIo,
+                   EfiPciIoWidthUint32,
+                   Bar,
+                   1,
+                        (VOID *) &TempBaseAddress
+                   );
+      PciIo->Pci.Read (
+                   PciIo,
+                   EfiPciIoWidthUint32,
+                   Bar,
+                   1,
+                       (VOID *) &TempBaseAddress
+                   );
       TempBaseAddress &= 0xfffffffe;
       MemSize = 1;
       while ((TempBaseAddress & 0x01) == 0) {
@@ -159,32 +155,32 @@ InitBadBars(
       //
       // Free up allocated memory memory and re-allocate with increased size.
       //
-      Status = gDS->FreeMemorySpace (
-                      BaseAddress,
-                      MemSize
-                      );
+      gDS->FreeMemorySpace (
+             BaseAddress,
+             MemSize
+             );
       //
       // Force new alignment
       //
       MemSize = 0x8000000;
       MemSizeBits = 28;
 
-      Status = gDS->AllocateMemorySpace (
-                      EfiGcdAllocateAnySearchBottomUp,
-                      EfiGcdMemoryTypeMemoryMappedIo,
-                      MemSizeBits,           // Alignment
-                      MemSize,
-                      &BaseAddress,
-                      mImageHandle,
-                      NULL
-                      );
-      Status = PciIo->Pci.Write (
-                            PciIo,
-                            EfiPciIoWidthUint32,
-                            Bar,
-                            1,
-                                 (VOID *) &BaseAddress
-                            );
+      gDS->AllocateMemorySpace (
+             EfiGcdAllocateAnySearchBottomUp,
+             EfiGcdMemoryTypeMemoryMappedIo,
+             MemSizeBits,           // Alignment
+             MemSize,
+             &BaseAddress,
+             mImageHandle,
+             NULL
+             );
+      PciIo->Pci.Write (
+                   PciIo,
+                   EfiPciIoWidthUint32,
+                   Bar,
+                   1,
+                        (VOID *) &BaseAddress
+                   );
 
       break;
     case    NCR_VENDOR_ID:
@@ -195,22 +191,22 @@ InitBadBars(
   //
   for (Bar = 0x10; Bar < 0x28; Bar+= 4) {
 
-    Status = PciIo->Pci.Read (
-                          PciIo,
-                          EfiPciIoWidthUint32,
-                          Bar,
-                          1,
-                              (VOID *) &BaseAddress
-                          );
+    PciIo->Pci.Read (
+                 PciIo,
+                 EfiPciIoWidthUint32,
+                 Bar,
+                 1,
+                     (VOID *) &BaseAddress
+                 );
     if (BaseAddress && 0x01) {
       TempBaseAddress = 0xffffffff;
-      Status = PciIo->Pci.Write (
-                            PciIo,
-                            EfiPciIoWidthUint32,
-                            Bar,
-                            1,
-                                 (VOID *) &TempBaseAddress
-                            );
+      PciIo->Pci.Write (
+                   PciIo,
+                   EfiPciIoWidthUint32,
+                   Bar,
+                   1,
+                        (VOID *) &TempBaseAddress
+                   );
       TempBaseAddress &= 0xfffffffc;
       IoSize = 1;
       while ((TempBaseAddress & 0x01) == 0) {
@@ -218,28 +214,28 @@ InitBadBars(
         IoSize = IoSize << 1;
       }
       if (IoSize < MIN_NCR_IO_SIZE) {
-        Status = gDS->FreeIoSpace (
-                        BaseAddress,
-                        IoSize
-                        );
-
-        Status = gDS->AllocateIoSpace (
-                        EfiGcdAllocateAnySearchTopDown,
-                        EfiGcdIoTypeIo,
-                        NCR_GRAN,           // Alignment
-                        MIN_NCR_IO_SIZE,
-                        &BaseAddress,
-                        mImageHandle,
-                        NULL
-                        );
+        gDS->FreeIoSpace (
+               BaseAddress,
+               IoSize
+               );
+
+        gDS->AllocateIoSpace (
+               EfiGcdAllocateAnySearchTopDown,
+               EfiGcdIoTypeIo,
+               NCR_GRAN,           // Alignment
+               MIN_NCR_IO_SIZE,
+               &BaseAddress,
+               mImageHandle,
+               NULL
+               );
         TempBaseAddress = BaseAddress + 1;
-        Status = PciIo->Pci.Write (
-                              PciIo,
-                              EfiPciIoWidthUint32,
-                              Bar,
-                              1,
-                                   (VOID *) &TempBaseAddress
-                              );
+        PciIo->Pci.Write (
+                     PciIo,
+                     EfiPciIoWidthUint32,
+                     Bar,
+                     1,
+                          (VOID *) &TempBaseAddress
+                     );
       }
     }
   }
@@ -255,13 +251,13 @@ InitBadBars(
         //  Controller.
         //  All Tekoa A2 or earlier step chips for now.
         //
-        Status = PciIo->Pci.Read (
-                              PciIo,
-                              EfiPciIoWidthUint8,
-                              PCI_REVISION_ID_OFFSET,
-                              1,
-                              &RevId
-                              );
+        PciIo->Pci.Read (
+                     PciIo,
+                     EfiPciIoWidthUint8,
+                     PCI_REVISION_ID_OFFSET,
+                     1,
+                     &RevId
+                     );
         if (RevId <= 0x02) {
           for (Bar = 0x14; Bar < 0x24; Bar+= 4) {
             //
@@ -269,13 +265,13 @@ InitBadBars(
             // Bars don't worry aboyut freeing up thge allocs.
             //
             TempBaseAddress = 0x0;
-            Status = PciIo->Pci.Write (
-                                  PciIo,
-                                  EfiPciIoWidthUint32,
-                                  Bar,
-                                  1,
-                                       (VOID *) &TempBaseAddress
-                                  );
+            PciIo->Pci.Write (
+                         PciIo,
+                         EfiPciIoWidthUint32,
+                         Bar,
+                         1,
+                              (VOID *) &TempBaseAddress
+                         );
           } // end for
         }
         else
@@ -286,13 +282,13 @@ InitBadBars(
           //since Tekoa does not fully support IDE Bus Mastering
           //
           TempBaseAddress = 0x0;
-          Status = PciIo->Pci.Write (
-                                PciIo,
-                                EfiPciIoWidthUint32,
-                                0x20,
-                                1,
-                                     (VOID *) &TempBaseAddress
-                                );
+          PciIo->Pci.Write (
+                       PciIo,
+                       EfiPciIoWidthUint32,
+                       0x20,
+                       1,
+                            (VOID *) &TempBaseAddress
+                       );
         }
       }
       break;
@@ -308,19 +304,17 @@ ProgramPciLatency(
   IN    EFI_PCI_IO_PROTOCOL           *PciIo
   )
 {
-  EFI_STATUS                          Status;
-
   //
   // Program Master Latency Timer
   //
   if (mSystemConfiguration.PciLatency != 0) {
-     Status = PciIo->Pci.Write (
-                           PciIo,
-                           EfiPciIoWidthUint8,
-                           PCI_LATENCY_TIMER_OFFSET,
-                           1,
-                           &mSystemConfiguration.PciLatency
-                           );
+     PciIo->Pci.Write (
+                  PciIo,
+                  EfiPciIoWidthUint8,
+                  PCI_LATENCY_TIMER_OFFSET,
+                  1,
+                  &mSystemConfiguration.PciLatency
+                  );
   }
   return;
 }
diff --git a/Vlv2TbltDevicePkg/PlatformDxe/Platform.c b/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
index 439b6d9..3d8cbe0 100644
--- a/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
+++ b/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
@@ -518,16 +518,15 @@ InitPciDevPME (
   )
 {
   UINTN                  VarSize;
-  EFI_STATUS             Status;
 
   VarSize = sizeof(SYSTEM_CONFIGURATION);
-  Status = gRT->GetVariable(
-                  NORMAL_SETUP_NAME,
-                  &gEfiNormalSetupGuid,
-                  NULL,
-                  &VarSize,
-                  &mSystemConfiguration
-                  );
+  gRT->GetVariable(
+         NORMAL_SETUP_NAME,
+         &gEfiNormalSetupGuid,
+         NULL,
+         &VarSize,
+         &mSystemConfiguration
+         );
 
   //
   //Program HDA PME_EN
@@ -577,21 +576,20 @@ InitThermalZone (
   )
 {
   UINTN                  VarSize;
-  EFI_STATUS             Status;
   EFI_GLOBAL_NVS_AREA_PROTOCOL       *GlobalNvsArea;
   VarSize = sizeof(SYSTEM_CONFIGURATION);
-  Status = gRT->GetVariable(
-                  NORMAL_SETUP_NAME,
-                  &gEfiNormalSetupGuid,
-                  NULL,
-                  &VarSize,
-                  &mSystemConfiguration
-                  );
-  Status = gBS->LocateProtocol (
-                  &gEfiGlobalNvsAreaProtocolGuid,
-                  NULL,
-                  (void **)&GlobalNvsArea
-                  );
+  gRT->GetVariable(
+         NORMAL_SETUP_NAME,
+         &gEfiNormalSetupGuid,
+         NULL,
+         &VarSize,
+         &mSystemConfiguration
+         );
+  gBS->LocateProtocol (
+         &gEfiGlobalNvsAreaProtocolGuid,
+         NULL,
+         (void **)&GlobalNvsArea
+         );
   GlobalNvsArea->Area->CriticalThermalTripPoint = mSystemConfiguration.CriticalThermalTripPoint;
   GlobalNvsArea->Area->PassiveThermalTripPoint = mSystemConfiguration.PassiveThermalTripPoint;
 }
-- 
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 ` [PATCH v2 13/19] Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the " Gary Lin
2016-07-29  3:25 ` [PATCH v2 14/19] Vlv2TbltDevicePkg/VlvPlatformInitDxe: Remove " Gary Lin
2016-07-29  3:25 ` Gary Lin [this message]
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-16-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