Topics

[PATCH v2 13/19] Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the unused variables


Gary Lin
 

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@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
---
.../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