From 530006647a8ab6d833c0ee839f999fb0e60f58b4 Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Fri, 29 Jul 2016 11:25:32 +0800 Subject: [PATCH] Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the unused variables 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 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin --- .../PlatformSetupDxe/SetupInfoRecords.c | 41 ++++++------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c b/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c index 3c6f8f447c..3cdb0132cd 100644 --- a/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c +++ b/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c @@ -520,7 +520,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; @@ -528,7 +527,6 @@ PrepareSetupInformation ( STRING_REF TokenToUpdate; EFI_PROCESSOR_VERSION_DATA *ProcessorVersion; UINTN Index; - UINT16 EeState; UINTN DataOutput; EFI_PROCESSOR_MICROCODE_REVISION_DATA *CpuUcodeRevisionData; @@ -546,11 +544,6 @@ PrepareSetupInformation ( SetMem(ReleaseDate, sizeof(ReleaseDate), 0); 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 // @@ -569,7 +562,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 @@ -805,8 +797,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; @@ -816,6 +806,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, @@ -825,8 +818,6 @@ UpdateAdditionalInformation ( ASSERT_EFI_ERROR(Status); - Size = 3; - MonotonicCount = 0; Record = NULL; do { @@ -841,12 +832,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) // @@ -1082,7 +1073,6 @@ JudgeHandleIsPCIDevice( { EFI_STATUS Status; EFI_DEVICE_PATH *DPath; - EFI_DEVICE_PATH *DevicePath; Status = gBS->HandleProtocol ( Handle, @@ -1091,7 +1081,6 @@ JudgeHandleIsPCIDevice( ); if(!EFI_ERROR(Status)) { - DevicePath = DPath; while(!IsDevicePathEnd(DPath)) { if((DPath->Type == HARDWARE_DEVICE_PATH) && (DPath->SubType == HW_PCI_DP)) @@ -1457,9 +1446,6 @@ GetChipsetSataPortSpeed ( UINT32 IdeAhciBar; EFI_PHYSICAL_ADDRESS MemBaseAddress = 0; UINT8 FunNum; - EFI_STATUS Status; - UINT32 DwordReg; - DeviceSpeed = 0x01; // generation 1 @@ -1469,15 +1455,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, @@ -1507,7 +1493,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)