From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AEC171A1E2C for ; Thu, 28 Jul 2016 20:26:28 -0700 (PDT) Received: from GaryWorkstation.apac.novell.com (ip-203-192-156-9.asianetcom.net [203.192.156.9]) by smtp.nue.novell.com with ESMTP (NOT encrypted); Fri, 29 Jul 2016 05:26:25 +0200 From: Gary Lin To: edk2-devel@lists.01.org Cc: David Wei Date: Fri, 29 Jul 2016 11:25:32 +0800 Message-Id: <20160729032538.17730-14-glin@suse.com> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160729032538.17730-1-glin@suse.com> References: <20160729032538.17730-1-glin@suse.com> MIME-Version: 1.0 Subject: [PATCH v2 13/19] Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the unused variables X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2016 03:26:29 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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