public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build
@ 2016-07-29  3:25 Gary Lin
  2016-07-29  3:25 ` [PATCH v2 01/19] Vlv2TbltDevicePkg: Amend the build script Gary Lin
                   ` (18 more replies)
  0 siblings, 19 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel

This series amend the build script of Vlv2TbltDevicePkg and fix the
error messages from gcc. I've built the firmware with gcc 6.1.1 on openSUSE
Tumbleweed, and the firmware binary[*] was generated successfully (but not
guaranteed to work).

[*] Vlv2TbltDevicePkg/Stitch/MNW2MAX_X64_D_0093_01_GCC.bin

The patches are also available in my github branch:
https://github.com/lcp/edk2/tree/Vlv2-gcc-fix-v2-platforms

Changes in v2:
1. Instead of removing MDEPKG_NDEBUG completely, amend the CFLAG to define
   MDEPKG_NDEBUG only for the gcc release build.
2. Remove the variable Hob and the related code from IchRcrbInit() in
   Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c.
3. Include UefiBootServicesTableLib.h in PlatformGopPolicy/PlatformGopPolicy.c
   so that we don't have to declare gBS.
4. Rebase the patchset on minnowboard-max-udk2015 of
   https://github.com/tianocore/edk2-platforms.git instead of the master of
   https://github.com/tianocore/edk2.git. Besides the patches of this series,
   minnowboard-max-udk2015 needs a few more commits from edk2.git to make it
   work with gcc6:
   * NetworkPkg: fix ASSERT_EFI_ERROR() typos
   * EdkCompatibilityPkg: fix ASSERT_EFI_ERROR() typos
   * Vlv2TbltDevicePkg: fix ASSERT_EFI_ERROR() typos
   * CryptoPkg/BaseCryptLib: Add missing OpenSSL includes
   * CryptoPkg/OpensslLib: Undefine NO_BUILTIN_VA_FUNCS to fix varargs breakage
   * CryptoPkg: Fix OpenSSL BN wordsize and OPENSSL_SYS_UEFI handling
   For convenience, I merged all the patches before and include openssl 1.0.2h
   update in my branch.

Gary Lin (19):
  Vlv2TbltDevicePkg: Amend the build script
  Vlv2TbltDevicePkg: Only define MDEPKG_NDEBUG for gcc release build
  Vlv2TbltDevicePkg/MultiPlatformLib: Remove the unused variables
  Vlv2TbltDevicePkg/PlatformPei: Remove the unused variable
  Vlv2TbltDevicePkg/PlatformBdsLib: Remove the unused variable
  Vlv2TbltDevicePkg/PlatformInitPei: Remove the unused variables
  Vlv2TbltDevicePkg/PlatformInitPei: Suppress the gcc error message
  Vlv2TbltDevicePkg/AcpiPlatform: Remove unused variables
  Vlv2TbltDevicePkg/AcpiPlatform: Amend the declaration of mGlobalNvsArea
  Vlv2TbltDevicePkg/PlatformGopPolicy: include UefiBootServicesTableLib.h
  Vlv2DeviceRefCodePkg/ValleyView2Soc: Remove the unused code
  Vlv2TbltDevicePkg/FvbRuntimeDxe: Remove unused variables
  Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the unused variables
  Vlv2TbltDevicePkg/VlvPlatformInitDxe: Remove unused variables
  Vlv2TbltDevicePkg/PlatformDxe: Remove the unused variables
  Vlv2TbltDevicePkg/Wpce791: Remove the unused variable
  Vlv2TbltDevicePkg/SmBiosMiscDxe: Remove unused variables
  Vlv2TbltDevicePkg/PpmPolicy: Remove the usage of global variables
  Vlv2TbltDevicePkg/PpmPolicy: Remove the unused variable

 .../SouthCluster/Include/PchAccess.h               |  49 -----
 Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c      |   9 +-
 Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h      |   2 +-
 Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c |   4 +-
 Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c       |  11 --
 .../MultiPlatformLib/BoardClkGens/BoardClkGens.c   |   5 +-
 .../Library/MultiPlatformLib/MultiPlatformLib.c    |  53 ++---
 .../Library/PlatformBdsLib/BdsPlatform.c           |   3 +-
 Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c        |   2 -
 Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c          | 214 ++++++++++-----------
 Vlv2TbltDevicePkg/PlatformDxe/Platform.c           |  40 ++--
 .../PlatformGopPolicy/PlatformGopPolicy.c          |   4 +-
 Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c |   2 -
 Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c    |  12 --
 .../PlatformInitPei/PlatformEarlyInit.c            |   1 +
 Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c     |   9 +-
 Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc            |   2 +-
 .../PlatformSetupDxe/SetupInfoRecords.c            |  41 ++--
 Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c            |  13 +-
 Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h            |   6 +-
 .../SmBiosMiscDxe/MiscOemType0x90Function.c        |   5 -
 .../SmBiosMiscDxe/MiscProcessorCacheFunction.c     |   2 -
 .../MiscProcessorInformationFunction.c             |   2 -
 Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c |   4 -
 Vlv2TbltDevicePkg/Wpce791/LpcDriver.c              |   4 -
 Vlv2TbltDevicePkg/bld_vlv.sh                       |  24 ++-
 26 files changed, 203 insertions(+), 320 deletions(-)

-- 
2.9.2



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

* [PATCH v2 01/19] Vlv2TbltDevicePkg: Amend the build script
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 02/19] Vlv2TbltDevicePkg: Only define MDEPKG_NDEBUG for gcc release build Gary Lin
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei, Wu, Hao A, Lu, ShifeiX A

Take the gcc version detection from OvmfPkg/build.sh instead of the
hardcoded GCC46.

Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@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/bld_vlv.sh | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/Vlv2TbltDevicePkg/bld_vlv.sh b/Vlv2TbltDevicePkg/bld_vlv.sh
index 569865f..538b3ef 100755
--- a/Vlv2TbltDevicePkg/bld_vlv.sh
+++ b/Vlv2TbltDevicePkg/bld_vlv.sh
@@ -177,8 +177,30 @@ sed -i '/^TARGET_ARCH/d' Conf/target.txt
 sed -i '/^TOOL_CHAIN_TAG/d' Conf/target.txt
 sed -i '/^MAX_CONCURRENT_THREAD_NUMBER/d' Conf/target.txt
 
+gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}')
+case $gcc_version in
+    4.5.*)
+      TARGET_TOOLS=GCC45
+      ;;
+    4.6.*)
+      TARGET_TOOLS=GCC46
+      ;;
+    4.7.*)
+      TARGET_TOOLS=GCC47
+      ;;
+    4.8.*)
+      TARGET_TOOLS=GCC48
+      ;;
+    4.9.*|4.1[0-9].*|5.*.*|6.*.*)
+      TARGET_TOOLS=GCC49
+      ;;
+    *)
+      TARGET_TOOLS=GCC44
+      ;;
+esac
+
 ACTIVE_PLATFORM=$PLATFORM_PACKAGE/PlatformPkgGcc"$Arch".dsc
-TOOL_CHAIN_TAG=GCC46
+TOOL_CHAIN_TAG=$TARGET_TOOLS
 MAX_CONCURRENT_THREAD_NUMBER=1
 echo ACTIVE_PLATFORM = $ACTIVE_PLATFORM                           >> Conf/target.txt
 echo TARGET          = $TARGET                                    >> Conf/target.txt
-- 
2.9.2



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

* [PATCH v2 02/19] Vlv2TbltDevicePkg: Only define MDEPKG_NDEBUG for gcc release build
  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 ` 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
                   ` (16 subsequent siblings)
  18 siblings, 1 reply; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei, Laszlo Ersek

We only enable "-Wno-unused-but-set-variable" for the release build
and gcc would complain that the varible passed to ASSERT_EFI_ERROR
wasn't used in the debug build. Just don't define MDEPKG_NDEBUG for
the debug build to make gcc happy with ASSERT_EFI_ERROR.

Suggested-by: Laszlo Ersek <lersek@redhat.com>
Cc: David Wei <david.wei@intel.com>
CC: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
 Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
index a3f4c9a..e57d2ad 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
@@ -1117,7 +1117,7 @@ [Components.X64]
     !endif
        <BuildOptions>
         ICC:*_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
-        GCC:*_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
+        GCC:RELEASE_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
   }
   MdeModulePkg/Universal/PCD/Dxe/Pcd.inf {
     <LibraryClasses>
-- 
2.9.2



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

* [PATCH v2 03/19] Vlv2TbltDevicePkg/MultiPlatformLib: Remove the unused variables
  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  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 04/19] Vlv2TbltDevicePkg/PlatformPei: Remove the unused variable Gary Lin
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei, Wu, Hao A, Lu, ShifeiX A

Fix the following errors from gcc:

Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.c: In function ‘MultiPlatformInfoInit’:
Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.c:47:14: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c: In function ‘ReadClockGeneratorID’:
Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c:222:33: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c: In function ‘ConfigurePlatformClocks’:
Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c:283:33: error: variable ‘ClockGenID’ set but not used [-Werror=unused-but-set-variable]

Also fix the coding style of MultiPlatformInfoInit()

Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@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>
---
 .../MultiPlatformLib/BoardClkGens/BoardClkGens.c   |  5 +-
 .../Library/MultiPlatformLib/MultiPlatformLib.c    | 53 ++++++++++++----------
 2 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c b/Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c
index 6d3bd77..000c864 100644
--- a/Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c
+++ b/Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c
@@ -210,7 +210,6 @@ ReadClockGeneratorID (
   IN     UINT8                         ClockAddress
   )
 {
-  EFI_STATUS                    Status;
   EFI_SMBUS_DEVICE_ADDRESS      SlaveAddress;
   UINT8                         Buffer[MAX_CLOCK_GENERATOR_BUFFER_LENGTH];
   UINTN                         Length;
@@ -222,7 +221,7 @@ ReadClockGeneratorID (
   SlaveAddress.SmbusDeviceAddress = ClockAddress >> 1;
   Length = sizeof (Buffer);
   Command = 0;
-  Status = SmbusPpi->Execute (
+  SmbusPpi->Execute (
     PeiServices,
     SmbusPpi,
     SlaveAddress,
@@ -271,7 +270,6 @@ ConfigurePlatformClocks (
 
   EFI_PLATFORM_INFO_HOB         *PlatformInfoHob;
   BOOLEAN                       EnableSpreadSpectrum;
-  UINT8                         ClockGenID=0;
   SYSTEM_CONFIGURATION          SystemConfiguration;
 
   UINTN                         Length;
@@ -324,7 +322,6 @@ ConfigurePlatformClocks (
       DEBUG((EFI_D_ERROR, "Clock Generator CK505 Not Present, vendor ID on board is %x\n",(Data & 0x0F)));
       return EFI_SUCCESS;
 }
-  ClockGenID = Data & 0x0F;
 
   EnableSpreadSpectrum = FALSE;
   VariableSize = sizeof (SYSTEM_CONFIGURATION);
diff --git a/Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.c b/Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.c
index d32deb5..dedcbe4 100644
--- a/Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.c
+++ b/Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.c
@@ -34,8 +34,7 @@ MultiPlatformInfoInit (
   IN OUT EFI_PLATFORM_INFO_HOB          *PlatformInfoHob
   )
 {
-  UINT32                                PcieLength;
-  EFI_STATUS      Status;
+  UINT32 PcieLength;
 
 
   PlatformInfoHob->IohSku = MmPci16(0, MC_BUS, MC_DEV, MC_FUN, PCI_DEVICE_ID_OFFSET);
@@ -52,10 +51,10 @@ MultiPlatformInfoInit (
 
   PlatformInfoHob->IchRevision = PchLpcPciCfg8(PCI_REVISION_ID_OFFSET);
 
-  	//
-    //64MB
-    //
-    PcieLength = 0x04000000;
+  //
+  //64MB
+  //
+  PcieLength = 0x04000000;
 
   //
   // Don't support BASE above 4GB currently.
@@ -95,28 +94,32 @@ MultiPlatformInfoInit (
   //
   PlatformInfoHob->SysData.SysIoApicEnable  = ICH_IOAPIC;
 
-   DEBUG ((EFI_D_ERROR,  "PlatformFlavor is %x (%x=tablet,%x=mobile,%x=desktop)\n", PlatformInfoHob->PlatformFlavor,FlavorTablet,FlavorMobile,FlavorDesktop));
+  DEBUG ((EFI_D_ERROR, "PlatformFlavor is %x (%x=tablet,%x=mobile,%x=desktop)\n",
+    PlatformInfoHob->PlatformFlavor,
+    FlavorTablet,
+    FlavorMobile,
+    FlavorDesktop));
 
-    //
-    // Get Platform Info and fill the Hob.
-    //
-    PlatformInfoHob->RevisonId = PLATFORM_INFO_HOB_REVISION;
+  //
+  // Get Platform Info and fill the Hob.
+  //
+  PlatformInfoHob->RevisonId = PLATFORM_INFO_HOB_REVISION;
 
-      //
-      // Get GPIO table
-      //
-      Status = MultiPlatformGpioTableInit (PeiServices, PlatformInfoHob);
+  //
+  // Get GPIO table
+  //
+  MultiPlatformGpioTableInit (PeiServices, PlatformInfoHob);
 
-      //
-      // Program GPIO
-      //
-      Status = MultiPlatformGpioProgram (PeiServices, PlatformInfoHob);
+  //
+  // Program GPIO
+  //
+  MultiPlatformGpioProgram (PeiServices, PlatformInfoHob);
 
-      //
-      // Update OemId
-      //
-      Status = InitializeBoardOemId (PeiServices, PlatformInfoHob);
-      Status = InitializeBoardSsidSvid (PeiServices, PlatformInfoHob);
+  //
+  // Update OemId
+  //
+  InitializeBoardOemId (PeiServices, PlatformInfoHob);
+  InitializeBoardSsidSvid (PeiServices, PlatformInfoHob);
 
-    return EFI_SUCCESS;
+  return EFI_SUCCESS;
 }
-- 
2.9.2



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

* [PATCH v2 04/19] Vlv2TbltDevicePkg/PlatformPei: Remove the unused variable
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (2 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 03/19] Vlv2TbltDevicePkg/MultiPlatformLib: Remove the unused variables Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 05/19] Vlv2TbltDevicePkg/PlatformBdsLib: " Gary Lin
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei, Wu, Hao A, Lu, ShifeiX A

Fix the following error from gcc:

Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c: In function ‘MemoryDiscoveredPpiNotifyCallback’:
Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c:115:20: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@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/PlatformPei/MemoryCallback.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c b/Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c
index 82954d3..9c769bf 100644
--- a/Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c
+++ b/Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c
@@ -103,7 +103,6 @@ MemoryDiscoveredPpiNotifyCallback (
   )
 {
 
-  EFI_STATUS       Status;
   EFI_BOOT_MODE    BootMode;
   UINT32           Pages;
   VOID*            Memory;
@@ -113,10 +112,10 @@ MemoryDiscoveredPpiNotifyCallback (
   // Allocate LM memory and configure PDM if enabled by user.
   // ConfigureLM(PeiServices);
   //
-  Status = (*PeiServices)->GetBootMode (
-                             (const EFI_PEI_SERVICES **)PeiServices,
-                             &BootMode
-                             );
+  (*PeiServices)->GetBootMode (
+                    (const EFI_PEI_SERVICES **)PeiServices,
+                    &BootMode
+                    );
 
   if (BootMode != BOOT_ON_S3_RESUME) {
     Size = (PcdGet32 (PcdFlashFvRecovery2Base) - PcdGet32 (PcdFlashFvMainBase)) + FixedPcdGet32(PcdFlashFvRecovery2Size);
-- 
2.9.2



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

* [PATCH v2 05/19] Vlv2TbltDevicePkg/PlatformBdsLib: Remove the unused variable
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (3 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 04/19] Vlv2TbltDevicePkg/PlatformPei: Remove the unused variable Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 06/19] Vlv2TbltDevicePkg/PlatformInitPei: Remove the unused variables Gary Lin
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei, Wu, Hao A, Lu, ShifeiX A

Fix the following error from gcc:

Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c: In function ‘BdsLockFv’:
Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c:2170:31: error: variable ‘Data’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@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/Library/PlatformBdsLib/BdsPlatform.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
index 1a3a306..6e8364b 100644
--- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
+++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
@@ -2226,7 +2226,6 @@ BdsLockFv (
   EFI_FV_BLOCK_MAP_ENTRY      *BlockMap;
   EFI_FIRMWARE_VOLUME_HEADER  *FvHeader;
   EFI_PHYSICAL_ADDRESS        BaseAddress;
-  UINT8                       Data;
   UINT32                      BlockLength;
   UINTN                       Index;
 
@@ -2237,7 +2236,7 @@ BdsLockFv (
   while ((BlockMap->NumBlocks != 0) && (BlockMap->Length != 0)) {
     BlockLength = BlockMap->Length;
     for (Index = 0; Index < BlockMap->NumBlocks; Index++) {
-      Data = MmioOr8 ((UINTN) BaseAddress, 0x03);
+      MmioOr8 ((UINTN) BaseAddress, 0x03);
       BaseAddress += BlockLength;
     }
     BlockMap++;
-- 
2.9.2



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

* [PATCH v2 06/19] Vlv2TbltDevicePkg/PlatformInitPei: Remove the unused variables
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (4 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 05/19] Vlv2TbltDevicePkg/PlatformBdsLib: " Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 07/19] Vlv2TbltDevicePkg/PlatformInitPei: Suppress the gcc error message Gary Lin
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei, Lu, ShifeiX A

Fix the following errors from gcc:

Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c: In function 'IchRcrbInit':
Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c:513:36: error: variable 'PlatformCpuInfo' set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c:512:35: error: variable 'LpcRevisionID' set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c: In function 'EndOfPeiPpiNotifyCallback':
Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c:64:31: error: variable 'MemoryTop' set but not used [-Werror=unused-but-set-variable]

v2:
  Also remove the variable, Hob, in PchInitPeim.c:IchRcrbInit() since
  no one really uses it.

Cc: David Wei <david.wei@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
 Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c |  2 --
 Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c    | 12 ------------
 2 files changed, 14 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c b/Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c
index 31cc88a..9d9c0e5 100644
--- a/Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c
+++ b/Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c
@@ -52,7 +52,6 @@ EndOfPeiPpiNotifyCallback (
   )
 {
   EFI_STATUS                  Status;
-  UINT64                      MemoryTop;
   UINT64                      LowUncableBase;
   EFI_PLATFORM_INFO_HOB       *PlatformInfo;
   UINT32                      HecBaseHigh;
@@ -100,7 +99,6 @@ EndOfPeiPpiNotifyCallback (
 
   LowUncableBase = PlatformInfo->MemData.MemMaxTolm;
   LowUncableBase &= (0x0FFF00000);
-  MemoryTop = (0x100000000);
 
   if (BootMode != BOOT_ON_S3_RESUME) {
     //
diff --git a/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c b/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
index 30f87c1..18ecda4 100644
--- a/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
+++ b/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
@@ -500,18 +500,8 @@ IchRcrbInit (
   IN SYSTEM_CONFIGURATION        *SystemConfiguration
   )
 {
-  UINT8                           LpcRevisionID;
-  EFI_PLATFORM_CPU_INFO           *PlatformCpuInfo;
-  EFI_PEI_HOB_POINTERS            Hob;
   EFI_BOOT_MODE                   BootMode;
 
-  //
-  // Get Platform Info HOB
-  //
-  Hob.Raw = GetFirstGuidHob (&gEfiPlatformCpuInfoGuid);
-  ASSERT (Hob.Raw != NULL);
-  PlatformCpuInfo = GET_GUID_HOB_DATA(Hob.Raw);
-
   (*PeiServices)->GetBootMode(PeiServices, &BootMode);
 
   //
@@ -530,8 +520,6 @@ IchRcrbInit (
   //
   // Initial RCBA according to the PeiRCBA table
   //
-  LpcRevisionID = PchLpcPciCfg8 (R_PCH_LPC_RID_CC);
-
   if ((BootMode == BOOT_ON_S3_RESUME)) {
     //
     // We are resuming from S3
-- 
2.9.2



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

* [PATCH v2 07/19] Vlv2TbltDevicePkg/PlatformInitPei: Suppress the gcc error message
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (5 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 06/19] Vlv2TbltDevicePkg/PlatformInitPei: Remove the unused variables Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 08/19] Vlv2TbltDevicePkg/AcpiPlatform: Remove unused variables Gary Lin
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei, Wu, Hao A, Lu, ShifeiX A

Fix the following error from gcc:

Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c: In function 'GetWakeupEventAndSaveToHob':
Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c:147:11: error: variable 'WakeEventData' set but not used [-Werror=unused-but-set-variable]

Although the function name is "GetWakeupEventAndSaveToHob",
WakeEventData was never really used or passed to any other function.
Given the fact that the function is served as an example, it'd better to
keep the code related to WakeEventData. Just add a debug statement to
suppress the error message.

Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@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/PlatformInitPei/PlatformEarlyInit.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c b/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c
index 27a6b07..5d3fde6 100644
--- a/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c
+++ b/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c
@@ -157,6 +157,7 @@ GetWakeupEventAndSaveToHob (
   }
 
   DEBUG ((EFI_D_ERROR, "ACPI Wake Status Register: %04x\n", Pm1Sts));
+  DEBUG ((EFI_D_ERROR, "ACPI Wake Event Data: %02x\n", WakeEventData));
 
   return EFI_SUCCESS;
 }
-- 
2.9.2



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

* [PATCH v2 08/19] Vlv2TbltDevicePkg/AcpiPlatform: Remove unused variables
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (6 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 07/19] Vlv2TbltDevicePkg/PlatformInitPei: Suppress the gcc error message Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 09/19] Vlv2TbltDevicePkg/AcpiPlatform: Amend the declaration of mGlobalNvsArea Gary Lin
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei, Wu, Hao A, Lu, ShifeiX A

Fix the following errors from gcc:

Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c: In function 'PlatformUpdateTables':
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c:236:63: warning: variable 'LocalApicCounter' set but not used [-Wunused-but-set-variable]
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c:214:64: warning: variable 'ProcessorLocalApicEntry' set but not used [-Wunused-but-set-variable]
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c:213:63: warning: variable 'BufferSize' set but not used [-Wunused-but-set-variable]

Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c: In function 'AcpiPlatformEntryPoint':
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c:797:33: warning: variable 'Data32' set but not used [-Wunused-but-set-variable]

Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c: In function ‘PatchGv3SsdtTable’:
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c:243:31: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@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/AcpiPlatform/AcpiPlatform.c      | 8 --------
 Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c | 3 +--
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
index 691a9d1..bb9cee5 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
@@ -210,8 +210,6 @@ PlatformUpdateTables (
   EFI_MP_SERVICES_PROTOCOL                                    *MpService;
   UINTN                                                       MaximumNumberOfCPUs;
   UINTN                                                       NumberOfEnabledCPUs;
-  UINTN                                                       BufferSize;
-  ACPI_APIC_STRUCTURE_PTR                                     *ProcessorLocalApicEntry;
   UINTN                                                       BspIndex;
   EFI_ACPI_1_0_ASF_DESCRIPTION_TABLE                          *AsfEntry;
   EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER            *HpetTbl;
@@ -233,7 +231,6 @@ PlatformUpdateTables (
   UINT16                                                      NumberOfHpets;
   UINT16                                                      HpetCapIdValue;
   UINT32                                                      HpetBlockID;
-  UINTN                                                       LocalApicCounter;
   EFI_PROCESSOR_INFORMATION                                   ProcessorInfoBuffer;
   UINT8                                                       TempVal;
   EFI_ACPI_3_0_IO_APIC_STRUCTURE                              *IOApicType;
@@ -242,9 +239,7 @@ PlatformUpdateTables (
   CurrPtr                 = NULL;
   EndPtr                  = NULL;
   ApicPtr                 = NULL;
-  LocalApicCounter        = 0;
   CurrProcessor           = 0;
-  ProcessorLocalApicEntry = NULL;
 
 
  if (Table->Signature != EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) {
@@ -372,7 +367,6 @@ PlatformUpdateTables (
               ApicPtr->AcpiLocalApic.AcpiProcessorId = (UINT8)MaximumNumberOfCPUs;
             }
 
-            BufferSize                    = 0;
             ApicPtr->AcpiLocalApic.Flags  = 0;
 
             for (CurrProcessor = 0; CurrProcessor < MaximumNumberOfCPUs; CurrProcessor++) {
@@ -797,7 +791,6 @@ AcpiPlatformEntryPoint (
   EFI_MP_SERVICES_PROTOCOL      *MpService;
   UINTN                         MaximumNumberOfCPUs;
   UINTN                         NumberOfEnabledCPUs;
-  UINT32                        Data32;
   PCH_STEPPING                  pchStepping;
   UINT32                        DxeGpioValue;
 
@@ -807,7 +800,6 @@ AcpiPlatformEntryPoint (
   Instance          = 0;
   CurrentTable      = NULL;
   TableHandle       = 0;
-  Data32            = 0;
 
   //
   // Update HOB variable for PCI resource information.
diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c
index 3489650..c89c07f 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c
@@ -232,7 +232,6 @@ PatchGv3SsdtTable (
   IN OUT   EFI_ACPI_DESCRIPTION_HEADER  *TableHeader
   )
 {
-  EFI_STATUS                  Status;
   UINT8                       *CurrPtr;
   UINT8                       *SsdtPointer;
   UINT32                      Signature;
@@ -328,7 +327,7 @@ PatchGv3SsdtTable (
         continue;
       }
 
-      Status      = EistProt->GetEistTable (EistProt, &EistInfo, (VOID **) &PssState);
+      EistProt->GetEistTable (EistProt, &EistInfo, (VOID **) &PssState);
 
       AdjustSize  = PssTable->NumEntries * sizeof (EFI_PSS_PACKAGE);
       AdjustSize -= EistInfo->NumStates * sizeof (EFI_PSS_PACKAGE);
-- 
2.9.2



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

* [PATCH v2 09/19] Vlv2TbltDevicePkg/AcpiPlatform: Amend the declaration of mGlobalNvsArea
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (7 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 08/19] Vlv2TbltDevicePkg/AcpiPlatform: Remove unused variables Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 10/19] Vlv2TbltDevicePkg/PlatformGopPolicy: include UefiBootServicesTableLib.h Gary Lin
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei

mGlobalNvsArea wasn't declared as extern in AcpiPlatform.h and the header
was included in AcpiPlatform.c and AcpiPlatformHooks.c. Although it's
declared as extern in AcpiPlatformHooks.c, gcc still created an instance
of mGlobalNvsArea in AcpiPlatformHooks.c since the header was expanded
first and then the linker complained "multiple definition". This commit
rearrange the delaration of mGlobalNvsArea to satisfy gcc.

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/AcpiPlatform/AcpiPlatform.c      | 1 +
 Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h      | 2 +-
 Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c | 1 -
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
index bb9cee5..70ad07e 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
@@ -66,6 +66,7 @@ CHAR16    gACPIOSFRRefDataBlockVariableName[] = ACPI_OSFR_REF_DATA_BLOCK_VARIABL
 CHAR16    gACPIOSFRMfgStringVariableName[] = ACPI_OSFR_MFG_STRING_VARIABLE_NAME;
 
 EFI_CPU_IO_PROTOCOL                    *mCpuIo;
+EFI_GLOBAL_NVS_AREA_PROTOCOL            mGlobalNvsArea;
 #ifndef __GNUC__
 #pragma optimize("", off)
 #endif
diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h
index fbc9272..8587beb 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h
@@ -59,7 +59,7 @@ Abstract:
 //
 // Global variables.
 //
-EFI_GLOBAL_NVS_AREA_PROTOCOL  mGlobalNvsArea;
+extern EFI_GLOBAL_NVS_AREA_PROTOCOL  mGlobalNvsArea;
 
 //
 // ACPI table information used to initialize tables.
diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c
index c89c07f..2dc9657 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c
@@ -33,7 +33,6 @@ Abstract:
 //
 #include "AcpiPlatformHooksLib.h"
 
-extern EFI_GLOBAL_NVS_AREA_PROTOCOL  mGlobalNvsArea;
 extern SYSTEM_CONFIGURATION             mSystemConfiguration;
 
 ENHANCED_SPEEDSTEP_PROTOCOL             *mEistProtocol  = NULL;
-- 
2.9.2



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

* [PATCH v2 10/19] Vlv2TbltDevicePkg/PlatformGopPolicy: include UefiBootServicesTableLib.h
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (8 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 09/19] Vlv2TbltDevicePkg/AcpiPlatform: Amend the declaration of mGlobalNvsArea Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 11/19] Vlv2DeviceRefCodePkg/ValleyView2Soc: Remove the unused code Gary Lin
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei, Wu, Hao A, Lu, ShifeiX A

gBS is already defined in
MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c

Remove the declaration of gBS and include the proper header file to
access the variable.

Suggested-by: David Wei <david.wei@intel.com>
Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
 Vlv2TbltDevicePkg/PlatformGopPolicy/PlatformGopPolicy.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformGopPolicy/PlatformGopPolicy.c b/Vlv2TbltDevicePkg/PlatformGopPolicy/PlatformGopPolicy.c
index 62cd188..86084b1 100644
--- a/Vlv2TbltDevicePkg/PlatformGopPolicy/PlatformGopPolicy.c
+++ b/Vlv2TbltDevicePkg/PlatformGopPolicy/PlatformGopPolicy.c
@@ -23,13 +23,11 @@ Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved
 
 #include <Guid/SetupVariable.h>
 #include <SetupMode.h>
+#include <Library/UefiBootServicesTableLib.h>
 #include <Library/UefiRuntimeServicesTableLib.h>
 #include "PchAccess.h"
 #include <Library/PchPlatformLib.h>
 
-EFI_BOOT_SERVICES   *gBS;
-
-
 PLATFORM_GOP_POLICY_PROTOCOL  mPlatformGOPPolicy;
 
 //
-- 
2.9.2



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

* [PATCH v2 11/19] Vlv2DeviceRefCodePkg/ValleyView2Soc: Remove the unused code
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (9 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 10/19] Vlv2TbltDevicePkg/PlatformGopPolicy: include UefiBootServicesTableLib.h Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 12/19] Vlv2TbltDevicePkg/FvbRuntimeDxe: Remove unused variables Gary Lin
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei

The code in _S3SUPPORT_ in PchAccess.h wasn't used in anywhere. Also,
The declaration of MCRX and MCR made gcc generate the error of
"multiple definition". Just remove the unused code to avoid any
potential issue.

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
 .../SouthCluster/Include/PchAccess.h               | 49 ----------------------
 1 file changed, 49 deletions(-)

diff --git a/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchAccess.h b/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchAccess.h
index 3f44d2b..d080e1b 100644
--- a/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchAccess.h
+++ b/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchAccess.h
@@ -474,53 +474,4 @@ typedef struct _PCH_MSG_BUS_TABLE_STRUCT {
   UINT32      WriteOpCode;
 } PCH_MSG_BUS_TABLE_STRUCT_TABLE_STRUCT;
 
-#ifndef _S3SUPPORT_
-#define _S3SUPPORT_
-UINTN MCRX;
-UINTN MCR;
-//
-// In S3 execute, we should follow the MSG BUS access procedure to restore the saving data.
-// To do so, we adopt READ ->> SAVE
-// Indirect IO access: (According BayTrail-M EDS chapter 3.6)
-// 1. Write Index port into MSG BUS_MCRX first.
-// 2. Write content to data register which is called MSG BUS_MDR.
-// 3. Send "message bus control" to complete the procedure.
-//
-#define S3BootScriptSaveMsgBusToMemWrite(PortId, Register, Dbuff, ReadOpCode, WriteOpCode) \
-{ \
-  MCRX = (UINTN) Register & MSGBUS_MASKHI; \
-  MCR = (UINTN) ((ReadOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX), (UINT32) MCRX); \
-  S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX),1, (VOID *) (UINTN) &MCRX); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR ), (UINT32) MCR); \
-  (Dbuff) = (UINT32) MmioRead32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR)); \
-  S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR),1, (VOID *) &Dbuff); \
-  MCR = (UINTN) ((WriteOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN); \
-  S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR),1, (VOID *) (UINTN) &MCR); \
-}
-
-//
-// This macro combines two function:  1. PchMsgBusAndThenOr32 ()  2. S3 boot script save
-//
-#define PchMsgBusAndThenOr32AddToS3Save(PortId, Register, Dbuff, AndData, OrData, ReadOpCode, WriteOpCode) \
-{ \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX), (UINT32) (Register & MSGBUS_MASKHI)); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR ), (UINT32) ((ReadOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN)); \
-  (Dbuff) = (UINT32) MmioRead32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR)); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX), (UINT32) (Register & MSGBUS_MASKHI)); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR ), (UINT32) ((Dbuff & AndData) | OrData)); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR ), (UINT32) ((WriteOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN)); \
-  MCRX = (UINTN) Register & MSGBUS_MASKHI; \
-  MCR = (UINTN) ((ReadOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX), (UINT32) MCRX); \
-  S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX),1,(VOID *) (UINTN) &MCRX); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR ), (UINT32) MCR); \
-  (Dbuff) = (UINT32) MmioRead32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR)); \
-  S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR),1,(VOID *) &Dbuff); \
-  MCR = (UINTN) ((WriteOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN); \
-  S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR),1,(VOID *) (UINTN) &MCR); \
-}
-
-#endif
-
 #endif
-- 
2.9.2



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

* [PATCH v2 12/19] Vlv2TbltDevicePkg/FvbRuntimeDxe: Remove unused variables
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (10 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 11/19] Vlv2DeviceRefCodePkg/ValleyView2Soc: Remove the unused code Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 13/19] Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the " Gary Lin
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei

Fix the following errors from gcc:

Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c: In function ‘FvbWriteBlock’:
Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c:368:44: error: variable ‘FwhInstance’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c: In function ‘FvbEraseBlock’:
Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c:448:44: error: variable ‘FwhInstance’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c: In function ‘FvbInitialize’:
Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c:1028:41: error: variable ‘FvHeaderValid’ 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>
---
 Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c b/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c
index 5c3d6dc..1cb5e9b 100644
--- a/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c
+++ b/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c
@@ -356,12 +356,9 @@ FvbWriteBlock (
   EFI_FVB_ATTRIBUTES_2                    Attributes;
   UINTN                                   LbaAddress;
   UINTN                                   LbaLength;
-  EFI_FW_VOL_INSTANCE                     *FwhInstance;
   EFI_STATUS                              Status;
   EFI_STATUS                              Status1;
 
-  FwhInstance = GetFvbInstance (Instance);
-
   if ( (NumBytes == NULL) || (Buffer == NULL)) {
     return (EFI_INVALID_PARAMETER);
   }
@@ -436,16 +433,10 @@ FvbEraseBlock (
 {
   EFI_FVB_ATTRIBUTES_2                    Attributes;
   UINTN                                   LbaAddress;
-  EFI_FW_VOL_INSTANCE                     *FwhInstance;
   UINTN                                   LbaLength;
   EFI_STATUS                              Status;
 
   //
-  // Find the right instance of the FVB private data.
-  //
-  FwhInstance = GetFvbInstance (Instance);
-
-  //
   // Check if the FV is write enabled.
   //
   Attributes = FvbGetVolumeAttributes (Instance);
@@ -1016,7 +1007,6 @@ FvbInitialize (
   UINTN                                 TmpHeaderLength;
   UINTN                                 Idx;
   UINT32                                MaxLbaSize;
-  BOOLEAN                               FvHeaderValid;
   EFI_BOOT_MODE                         BootMode;
   UINT32                                PlatformFvBaseAddress[3];
   UINT32                                PlatformFvBaseAddressCount;
@@ -1072,7 +1062,6 @@ FvbInitialize (
     FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;
 
     if (!IsFvHeaderValid (BaseAddress, FwVolHeader)) {
-      FvHeaderValid = FALSE;
       //
       // If not valid, get FvbInfo from the information carried in
       // FVB driver.
-- 
2.9.2



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

* [PATCH v2 13/19] Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the unused variables
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (11 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 12/19] Vlv2TbltDevicePkg/FvbRuntimeDxe: Remove unused variables Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 14/19] Vlv2TbltDevicePkg/VlvPlatformInitDxe: Remove " Gary Lin
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei

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



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

* [PATCH v2 14/19] Vlv2TbltDevicePkg/VlvPlatformInitDxe: Remove unused variables
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (12 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 13/19] Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the " Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 15/19] Vlv2TbltDevicePkg/PlatformDxe: Remove the " Gary Lin
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei, Wu, Hao A

Fix the following errors from gcc:

Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c: In function ‘GetIntegratedIntelVbtPtr’:
Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c:145:33: error: variable ‘VbtSize’ set but not used [-Werror=unused-but-set-variable]

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

Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@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/VlvPlatformInitDxe/IgdOpRegion.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c b/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
index 2200e6c..f8dc3f1 100644
--- a/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
+++ b/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
@@ -133,7 +133,6 @@ GetIntegratedIntelVbtPtr (
 {
   EFI_STATUS                    Status;
   EFI_PHYSICAL_ADDRESS          VbtAddress = 0;
-  UINT32                        VbtSize = 0;
   UINTN                         FvProtocolCount;
   EFI_HANDLE                    *FvHandles;
   EFI_FIRMWARE_VOLUME_PROTOCOL  *Fv;
@@ -174,7 +173,6 @@ GetIntegratedIntelVbtPtr (
 
       if (!EFI_ERROR (Status)) {
         VbtAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)Buffer;
-        VbtSize = (UINT32)VbtBufferSize;
         Status = EFI_SUCCESS;
         break;
       }
@@ -406,7 +404,6 @@ JudgeHandleIsPCIDevice(
 {
   EFI_STATUS  Status;
   EFI_DEVICE_PATH   *DPath;
-  EFI_DEVICE_PATH   *DevicePath;
 
   Status = gBS->HandleProtocol (
                   Handle,
@@ -414,7 +411,6 @@ JudgeHandleIsPCIDevice(
                   (VOID **) &DPath
                   );
   if(!EFI_ERROR(Status)) {
-    DevicePath = DPath;
     while(!IsDevicePathEnd(DPath)) {
       if((DPath->Type == HARDWARE_DEVICE_PATH) && (DPath->SubType == HW_PCI_DP)) {
         PCI_DEVICE_PATH   *PCIPath;
-- 
2.9.2



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

* [PATCH v2 15/19] Vlv2TbltDevicePkg/PlatformDxe: Remove the unused variables
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (13 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 14/19] Vlv2TbltDevicePkg/VlvPlatformInitDxe: Remove " Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 16/19] Vlv2TbltDevicePkg/Wpce791: Remove the unused variable Gary Lin
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei

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



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

* [PATCH v2 16/19] Vlv2TbltDevicePkg/Wpce791: Remove the unused variable
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (14 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 15/19] Vlv2TbltDevicePkg/PlatformDxe: Remove the " Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 17/19] Vlv2TbltDevicePkg/SmBiosMiscDxe: Remove unused variables Gary Lin
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei

Fix the following error from gcc:

Vlv2TbltDevicePkg/Wpce791/LpcDriver.c: In function ‘LpcDriverStart’:
Vlv2TbltDevicePkg/Wpce791/LpcDriver.c:239:27: error: variable ‘LpcDev’ 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>
---
 Vlv2TbltDevicePkg/Wpce791/LpcDriver.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/Vlv2TbltDevicePkg/Wpce791/LpcDriver.c b/Vlv2TbltDevicePkg/Wpce791/LpcDriver.c
index be99b4c..5b0c25c 100644
--- a/Vlv2TbltDevicePkg/Wpce791/LpcDriver.c
+++ b/Vlv2TbltDevicePkg/Wpce791/LpcDriver.c
@@ -227,10 +227,6 @@ LpcDriverStart (
 {
   EFI_STATUS             Status;
   EFI_PCI_IO_PROTOCOL    *PciIo;
-  LPC_DEV                *LpcDev;
-
-
-  LpcDev = NULL;
 
   //
   // Get Pci IO
-- 
2.9.2



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

* [PATCH v2 17/19] Vlv2TbltDevicePkg/SmBiosMiscDxe: Remove unused variables
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (15 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 16/19] Vlv2TbltDevicePkg/Wpce791: Remove the unused variable Gary Lin
@ 2016-07-29  3:25 ` 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
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei

Fix the following errors from gcc:

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

Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c: In function ‘AddSmbiosT0x90Callback’:
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c:292:28: error: variable ‘ForType90InputData’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c: In function ‘MiscProcessorInformationFunction’:
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c:191:37: error: variable ‘SrcDataSize’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c: In function ‘MiscProcessorCacheFunction’:
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c:78:34: error: variable ‘SrcDataSize’ 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/SmBiosMiscDxe/MiscOemType0x90Function.c          | 5 -----
 Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c       | 2 --
 Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c | 2 --
 3 files changed, 9 deletions(-)

diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c
index 2d0bf8b..9e04907 100644
--- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c
+++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c
@@ -152,7 +152,6 @@ JudgeHandleIsPCIDevice(
 {
   EFI_STATUS  Status;
   EFI_DEVICE_PATH   *DPath;
-  EFI_DEVICE_PATH   *DevicePath;
 
   Status = gBS->HandleProtocol (
                   Handle,
@@ -160,7 +159,6 @@ JudgeHandleIsPCIDevice(
                   (VOID **) &DPath
                   );
   if(!EFI_ERROR(Status)) {
-    DevicePath = DPath;
     while(!IsDevicePathEnd(DPath)) {
       if((DPath->Type == HARDWARE_DEVICE_PATH) && (DPath->SubType == HW_PCI_DP)) {
         PCI_DEVICE_PATH   *PCIPath;
@@ -280,7 +278,6 @@ AddSmbiosT0x90Callback (
   UINTN                 SteppingStrLen = 0;
   SMBIOS_TABLE_TYPE90    *SmbiosRecord;
   EFI_SMBIOS_HANDLE     SmbiosHandle;
-  EFI_MISC_OEM_TYPE_0x90  *ForType90InputData;
   CHAR16                *SECVer;
   CHAR16                *uCodeVer;
   CHAR16                *GOPVer;
@@ -289,8 +286,6 @@ AddSmbiosT0x90Callback (
   CHAR8                 *OptionalStrStart;
   EFI_SMBIOS_PROTOCOL               *SmbiosProtocol;
 
-  ForType90InputData        = (EFI_MISC_OEM_TYPE_0x90 *)Context;
-
   DEBUG ((EFI_D_INFO, "Executing SMBIOS T0x90 callback.\n"));
 
   gBS->CloseEvent (Event);    // Unload this event.
diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c
index cbed988..b18a6aa 100644
--- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c
+++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c
@@ -66,7 +66,6 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscProcessorCache)
 	EFI_DATA_RECORD_HEADER          *Record;
 	EFI_SUBCLASS_TYPE1_HEADER       *DataHeader;
 	UINT8                           *SrcData;
-	UINT32                          SrcDataSize;
 	EFI_STATUS                      Status;
 
 	//
@@ -113,7 +112,6 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscProcessorCache)
 			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);
 				if (CompareGuid(&Record->DataRecordGuid, &gEfiCacheSubClassGuid) && (DataHeader->RecordType == CacheSizeRecordType)) {
           			if (DataHeader->SubInstance == EFI_CACHE_L1) {
 						SmbiosRecordL1->InstalledSize += (UINT16) (ConvertBase2ToRaw((EFI_EXP_BASE2_DATA *)SrcData) >> 10);
diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c
index 005b43c..bd988db 100644
--- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c
+++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c
@@ -179,7 +179,6 @@ MISC_SMBIOS_TABLE_FUNCTION (MiscProcessorInformation)
     EFI_DATA_RECORD_HEADER          *Record;
     EFI_SUBCLASS_TYPE1_HEADER       *DataHeader;
     UINT8                           *SrcData;
-    UINT32                          SrcDataSize;
     EFI_PROCESSOR_VERSION_DATA      *ProcessorVersion;
     CHAR16                          *NewStringToken;
     STRING_REF                      TokenToUpdate;
@@ -225,7 +224,6 @@ MISC_SMBIOS_TABLE_FUNCTION (MiscProcessorInformation)
 
             DataHeader  = (EFI_SUBCLASS_TYPE1_HEADER *)(Record + 1);
             SrcData     = (UINT8  *)(DataHeader + 1);
-            SrcDataSize = Record->RecordSize - Record->HeaderSize - sizeof (EFI_SUBCLASS_TYPE1_HEADER);
 
             //
             // Processor
-- 
2.9.2



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

* [PATCH v2 18/19] Vlv2TbltDevicePkg/PpmPolicy: Remove the usage of global variables
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (16 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 17/19] Vlv2TbltDevicePkg/SmBiosMiscDxe: Remove unused variables Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  2016-07-29  3:25 ` [PATCH v2 19/19] Vlv2TbltDevicePkg/PpmPolicy: Remove the unused variable Gary Lin
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei

gcc issued the error of "multiple deifintion" since gBS was also defined
in MdePkg/Library/UefiBootServicesTableLib. Actually those global variables,
gBS, pBS, and pRS, in PpmPolicy.h were only used in one function. Besides,
gBS and pRS were not really used. Remove gBS and pRS and declare pBS in
PpmPolicyEntry() to satisfy gcc.

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/PpmPolicy/PpmPolicy.c | 10 +++-------
 Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h |  6 +-----
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
index 2f8996b..fb4e7fc 100644
--- a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
+++ b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
@@ -33,8 +33,6 @@ Abstract:
 #define EFI_CPUID_MODEL                       0x00F0
 #define EFI_CPUID_STEPPING                    0x000F
 
-
-
 EFI_STATUS 
 EFIAPI
 PpmPolicyEntry(
@@ -42,6 +40,7 @@ PpmPolicyEntry(
   IN EFI_SYSTEM_TABLE *SystemTable
 )
 {
+  EFI_BOOT_SERVICES        *pBS;
   EFI_MP_SERVICES_PROTOCOL *MpService;
   EFI_CPUID_REGISTER        Cpuid01 = { 0, 0, 0, 0};
   EFI_HANDLE                Handle;
@@ -52,15 +51,12 @@ PpmPolicyEntry(
 
   PCH_STEPPING              Stepping;
 
-
-  gBS = SystemTable->BootServices;
   pBS = SystemTable->BootServices;
-  pRS = SystemTable->RuntimeServices;
 
   //
   // Set PPM policy structure to known value
   //
-  gBS->SetMem (&mDxePlatformPpmPolicy, sizeof(PPM_PLATFORM_POLICY_PROTOCOL), 0);
+  pBS->SetMem (&mDxePlatformPpmPolicy, sizeof(PPM_PLATFORM_POLICY_PROTOCOL), 0);
 
   //
   // Find the MpService Protocol
@@ -147,7 +143,7 @@ PpmPolicyEntry(
   mDxePlatformPpmPolicy.S3RestoreMsrSwSmiNumber                       = S3_RESTORE_MSR_SW_SMI;
 
   Handle = NULL;
-  Status = gBS->InstallMultipleProtocolInterfaces (
+  Status = pBS->InstallMultipleProtocolInterfaces (
                                                   &Handle,
                                                   &gPpmPlatformPolicyProtocolGuid,
                                                   &mDxePlatformPpmPolicy,
diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h
index cd3676b..cc7bed7 100644
--- a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h
+++ b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h
@@ -31,10 +31,6 @@ PPM_PLATFORM_POLICY_PROTOCOL    mDxePlatformPpmPolicy;
 #define  ICH_DEVICE_ENABLE       1
 #define  ICH_DEVICE_DISABLE      0
 
-EFI_BOOT_SERVICES     *gBS;
-EFI_BOOT_SERVICES     *pBS;
-EFI_RUNTIME_SERVICES  *pRS;
-
 #define POWER_STATE_SWITCH_SMI                       43
 #define ENABLE_C_STATE_IO_REDIRECTION_SMI            70
 #define DISABLE_C_STATE_IO_REDIRECTION_SMI           71
@@ -43,4 +39,4 @@ EFI_RUNTIME_SERVICES  *pRS;
 #define ENABLE_P_STATE_HARDWARE_COORDINATION_SMI     74
 #define DISABLE_P_STATE_HARDWARE_COORDINATION_SMI    75
 #define S3_RESTORE_MSR_SW_SMI                        48
-#define ENABLE_C6_RESIDENCY_SMI                      76
\ No newline at end of file
+#define ENABLE_C6_RESIDENCY_SMI                      76
-- 
2.9.2



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

* [PATCH v2 19/19] Vlv2TbltDevicePkg/PpmPolicy: Remove the unused variable
  2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
                   ` (17 preceding siblings ...)
  2016-07-29  3:25 ` [PATCH v2 18/19] Vlv2TbltDevicePkg/PpmPolicy: Remove the usage of global variables Gary Lin
@ 2016-07-29  3:25 ` Gary Lin
  18 siblings, 0 replies; 21+ messages in thread
From: Gary Lin @ 2016-07-29  3:25 UTC (permalink / raw)
  To: edk2-devel; +Cc: David Wei

Fix the following error from gcc:

Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c: In function ‘PpmPolicyEntry’:
Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c:50:29: error: variable ‘MaxRatio’ 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/PpmPolicy/PpmPolicy.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
index fb4e7fc..ec0c0f5 100644
--- a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
+++ b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
@@ -46,7 +46,6 @@ PpmPolicyEntry(
   EFI_HANDLE                Handle;
   EFI_STATUS                Status;
   UINTN                     CpuCount;
-  UINT64                    MaxRatio;
   UINT8                     CPUMobileFeature;
 
   PCH_STEPPING              Stepping;
@@ -77,8 +76,6 @@ PpmPolicyEntry(
   // Store the CPUID for use by SETUP items.
   //
   AsmCpuid (EFI_CPUID_VERSION_INFO, &Cpuid01.RegEax, &Cpuid01.RegEbx, &Cpuid01.RegEcx, &Cpuid01.RegEdx);
-  MaxRatio = ((RShiftU64 (AsmReadMsr64(EFI_MSR_IA32_PLATFORM_ID), 8)) & 0x1F);
-
 
   mDxePlatformPpmPolicy.Revision                       = PPM_PLATFORM_POLICY_PROTOCOL_REVISION_4;
 
-- 
2.9.2



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

* Re: [PATCH v2 02/19] Vlv2TbltDevicePkg: Only define MDEPKG_NDEBUG for gcc release build
  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
  0 siblings, 0 replies; 21+ messages in thread
From: Laszlo Ersek @ 2016-07-29  7:42 UTC (permalink / raw)
  To: Gary Lin, edk2-devel; +Cc: David Wei

On 07/29/16 05:25, Gary Lin wrote:
> We only enable "-Wno-unused-but-set-variable" for the release build
> and gcc would complain that the varible passed to ASSERT_EFI_ERROR
> wasn't used in the debug build. Just don't define MDEPKG_NDEBUG for
> the debug build to make gcc happy with ASSERT_EFI_ERROR.
> 
> Suggested-by: Laszlo Ersek <lersek@redhat.com>
> Cc: David Wei <david.wei@intel.com>
> CC: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Gary Lin <glin@suse.com>
> ---
>  Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> index a3f4c9a..e57d2ad 100644
> --- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> +++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
> @@ -1117,7 +1117,7 @@ [Components.X64]
>      !endif
>         <BuildOptions>
>          ICC:*_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
> -        GCC:*_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
> +        GCC:RELEASE_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
>    }
>    MdeModulePkg/Universal/PCD/Dxe/Pcd.inf {
>      <LibraryClasses>
> 

Acked-by: Laszlo Ersek <lersek@redhat.com>


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

end of thread, other threads:[~2016-07-29  7:42 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [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

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