From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id BEB29AC0D58 for ; Fri, 5 Jul 2024 09:34:16 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=W5CUCzWc0Pn6G+u1Ue6L+d3SRbdSq5gsHEWM+IzdQy8=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1720172056; v=1; b=brjEGNlN38ASScrlGo2CU8KvEFSg7So0p9mTIUdkqx5n+GgIBodPxmKKWo3tRQNZ7U07Np1q HJuLuto2HFhpWw8QUCf5FHKa0Bb8DIg12ovzSEiJrENk+lOLHQrj/gcdcT8BBSzEMCsaAUJ+T8e DFFVIkabzwJohpy2vMasJ/cSyDeco7G9Smpl/aOYOEvOGOuQsNV+hPvIFll9Z35HXN33NDe2WSP kXzYTYmUG+KN03rpKkSXOzzdIoezr7QtxyxdVyErZETchjJwVxlhCmGzjsYYKfz+3Na4NLf0zwK VtEzqkzugqtNq+1/JKqXdPZ/xYvFQWfby1T/DtM9P002Q== X-Received: by 127.0.0.2 with SMTP id cq1QYY7687511xqyJANtdOUB; Fri, 05 Jul 2024 02:34:15 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mx.groups.io with SMTP id smtpd.web10.13403.1720172054463171534 for ; Fri, 05 Jul 2024 02:34:14 -0700 X-CSE-ConnectionGUID: oNJ97zlnQb+3XYnm2cJ5ZA== X-CSE-MsgGUID: neMNpx8aSBmnswY8vgODRg== X-IronPort-AV: E=McAfee;i="6700,10204,11123"; a="34902460" X-IronPort-AV: E=Sophos;i="6.09,184,1716274800"; d="scan'208";a="34902460" X-Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2024 02:34:14 -0700 X-CSE-ConnectionGUID: KlSb30BaSNOS2fhC0Cs7yA== X-CSE-MsgGUID: 5/p0IupwToyTJ/j9xUE7+Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,184,1716274800"; d="scan'208";a="51245445" X-Received: from tedkuo1-desk1.gar.corp.intel.com ([10.225.76.14]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2024 02:34:12 -0700 From: "Kuo, Ted" To: devel@edk2.groups.io Cc: Liming Gao , Bob Feng , Yuwei Chen Subject: [edk2-devel][PATCH][edk2-staging] BaseTools: Fix BaseTools compilation issues Date: Fri, 5 Jul 2024 17:31:31 +0800 Message-Id: <1287dcdf308fe882db0ed2d229f8ea28434b3707.1720171761.git.ted.kuo@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 05 Jul 2024 02:34:14 -0700 Resent-From: ted.kuo@intel.com Reply-To: devel@edk2.groups.io,ted.kuo@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 7ysN3WmgwjvYdBb1fznbfwMTx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=brjEGNlN; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io https://bugzilla.tianocore.org/show_bug.cgi?id=3D4798 This patch removes unused variables that were causing compilation errors when building EDK2/BaseTools with GCC with the compiler flag Wunused-but-set-variable set. Cc: Liming Gao Cc: Bob Feng Cc: Yuwei Chen Signed-off-by: Ted Kuo --- BaseTools/Source/C/BfmLib/BfmLib.c | 26 -------------------------- BaseTools/Source/C/FMMT/FmmtLib.c | 26 -------------------------- 2 files changed, 52 deletions(-) diff --git a/BaseTools/Source/C/BfmLib/BfmLib.c b/BaseTools/Source/C/BfmLib= /BfmLib.c index c247cc8e1d..0893356b08 100644 --- a/BaseTools/Source/C/BfmLib/BfmLib.c +++ b/BaseTools/Source/C/BfmLib/BfmLib.c @@ -363,11 +363,9 @@ LibGetFvSize ( )=0D {=0D =0D - UINTN BytesRead;=0D UINT32 Size;=0D EFI_FV_BLOCK_MAP_ENTRY BlockMap;=0D =0D - BytesRead =3D 0;=0D Size =3D 0;=0D =0D if (InputFile =3D=3D NULL || FvSize =3D=3D NULL) {=0D @@ -377,7 +375,6 @@ LibGetFvSize ( fseek (InputFile, sizeof (EFI_FIRMWARE_VOLUME_HEADER) - sizeof (EFI_FV_B= LOCK_MAP_ENTRY), SEEK_CUR);=0D do {=0D fread (&BlockMap, sizeof (EFI_FV_BLOCK_MAP_ENTRY), 1, InputFile);=0D - BytesRead +=3D sizeof (EFI_FV_BLOCK_MAP_ENTRY);=0D =0D if (BlockMap.NumBlocks !=3D 0) {=0D Size +=3D BlockMap.NumBlocks * BlockMap.Length;=0D @@ -1032,7 +1029,6 @@ LibParseSection ( CHAR16 *UIName;=0D UINT32 UINameSize;=0D BOOLEAN HasDepexSection;=0D - UINT32 NumberOfSections;=0D BOOLEAN IsFfsGenerated;=0D ENCAP_INFO_DATA *LocalEncapData;=0D CHAR8 *BlankChar;=0D @@ -1058,7 +1054,6 @@ LibParseSection ( ParsedLength =3D 0;=0D ToolOutputLength =3D 0;=0D UINameSize =3D 0;=0D - NumberOfSections =3D 0;=0D UncompressedLength =3D 0;=0D CompressedLength =3D 0;=0D CompressionType =3D 0;=0D @@ -1116,7 +1111,6 @@ LibParseSection ( EncapDataNeedUpdata =3D TRUE;=0D =0D Level ++;=0D - NumberOfSections ++;=0D =0D CurrentFv->FfsAttuibutes[*FfsCount].IsLeaf =3D FALSE;=0D =0D @@ -1171,7 +1165,6 @@ LibParseSection ( =0D case EFI_SECTION_COMPRESSION:=0D Level ++;=0D - NumberOfSections ++;=0D =0D EncapDataNeedUpdata =3D TRUE;=0D //=0D @@ -1317,7 +1310,6 @@ LibParseSection ( // a GUID defined FV section.=0D //=0D Level ++;=0D - NumberOfSections++;=0D =0D EncapDataNeedUpdata =3D TRUE;=0D //=0D @@ -1583,7 +1575,6 @@ LibParseSection ( //Leaf sections=0D //=0D case EFI_SECTION_RAW:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D if (!ViewFlag) {=0D if (!IsFfsGenerated) {=0D @@ -1594,7 +1585,6 @@ LibParseSection ( =0D break;=0D case EFI_SECTION_PE32:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D if (!ViewFlag) {=0D if (!IsFfsGenerated) {=0D @@ -1605,7 +1595,6 @@ LibParseSection ( =0D break;=0D case EFI_SECTION_PIC:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D if (!ViewFlag) {=0D if (!IsFfsGenerated) {=0D @@ -1616,7 +1605,6 @@ LibParseSection ( =0D break;=0D case EFI_SECTION_TE:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D if (!ViewFlag) {=0D if (!IsFfsGenerated) {=0D @@ -1627,7 +1615,6 @@ LibParseSection ( break;=0D =0D case EFI_SECTION_COMPATIBILITY16:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D =0D if (!ViewFlag) {=0D @@ -1639,7 +1626,6 @@ LibParseSection ( break;=0D =0D case EFI_SECTION_FREEFORM_SUBTYPE_GUID:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D if (!ViewFlag) {=0D if (!IsFfsGenerated) {=0D @@ -1650,27 +1636,22 @@ LibParseSection ( break;=0D =0D case EFI_SECTION_VERSION:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D break;=0D case EFI_SECTION_PEI_DEPEX:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D HasDepexSection =3D TRUE;=0D break;=0D case EFI_SECTION_DXE_DEPEX:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D HasDepexSection =3D TRUE;=0D break;=0D case EFI_SECTION_SMM_DEPEX:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D HasDepexSection =3D TRUE;=0D break;=0D =0D case EFI_SECTION_USER_INTERFACE:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D =0D UiSectionLength =3D FvBufExpand3ByteSize (((EFI_USER_INTERFACE_SECTI= ON *) Ptr)->CommonHeader.Size);=0D @@ -1975,7 +1956,6 @@ LibGetFvInfo ( )=0D {=0D EFI_STATUS Status;=0D - UINTN NumberOfFiles;=0D BOOLEAN ErasePolarity;=0D UINTN FvSize;=0D EFI_FFS_FILE_HEADER2 *CurrentFile;=0D @@ -1983,7 +1963,6 @@ LibGetFvInfo ( ENCAP_INFO_DATA *LocalEncapData;=0D EFI_FIRMWARE_VOLUME_EXT_HEADER *ExtHdrPtr;=0D =0D - NumberOfFiles =3D 0;=0D Key =3D 0;=0D LocalEncapData =3D NULL;=0D CurrentFile =3D NULL;=0D @@ -2147,11 +2126,6 @@ LibGetFvInfo ( =0D while (CurrentFile !=3D NULL) {=0D =0D - //=0D - // Increment the number of files counter=0D - //=0D - NumberOfFiles++;=0D -=0D //=0D // Store FFS file Header information=0D //=0D diff --git a/BaseTools/Source/C/FMMT/FmmtLib.c b/BaseTools/Source/C/FMMT/Fm= mtLib.c index e1436112ca..20e3e1acfc 100644 --- a/BaseTools/Source/C/FMMT/FmmtLib.c +++ b/BaseTools/Source/C/FMMT/FmmtLib.c @@ -552,11 +552,9 @@ LibGetFvSize ( )=0D {=0D =0D - UINTN BytesRead;=0D UINT32 Size;=0D EFI_FV_BLOCK_MAP_ENTRY BlockMap;=0D =0D - BytesRead =3D 0;=0D Size =3D 0;=0D =0D if (InputFile =3D=3D NULL || FvSize =3D=3D NULL) {=0D @@ -567,7 +565,6 @@ LibGetFvSize ( fseek (InputFile, sizeof (EFI_FIRMWARE_VOLUME_HEADER) - sizeof (EFI_FV_B= LOCK_MAP_ENTRY), SEEK_CUR);=0D do {=0D fread (&BlockMap, sizeof (EFI_FV_BLOCK_MAP_ENTRY), 1, InputFile);=0D - BytesRead +=3D sizeof (EFI_FV_BLOCK_MAP_ENTRY);=0D =0D if (BlockMap.NumBlocks !=3D 0) {=0D Size +=3D BlockMap.NumBlocks * BlockMap.Length;=0D @@ -813,7 +810,6 @@ LibParseSection ( CHAR16 *UIName;=0D UINT32 UINameSize;=0D BOOLEAN HasDepexSection;=0D - UINT32 NumberOfSections;=0D ENCAP_INFO_DATA *LocalEncapData;=0D ENCAP_INFO_DATA *LocalEncapDataTemp;=0D CHAR8 *BlankChar;=0D @@ -846,7 +842,6 @@ LibParseSection ( ParsedLength =3D 0;=0D ToolOutputLength =3D 0;=0D UINameSize =3D 0;=0D - NumberOfSections =3D 0;=0D UncompressedLength =3D 0;=0D CompressedLength =3D 0;=0D CompressionType =3D 0;=0D @@ -910,7 +905,6 @@ LibParseSection ( HasUiSection =3D TRUE;=0D =0D Level ++;=0D - NumberOfSections ++;=0D =0D CurrentFv->FfsAttuibutes[*FfsCount].IsLeaf =3D FALSE;=0D CurrentFv->FfsAttuibutes[*FfsCount].IsFvStart =3D TRUE;=0D @@ -1021,7 +1015,6 @@ LibParseSection ( Level ++;=0D }=0D }=0D - NumberOfSections ++;=0D =0D EncapDataNeedUpdata =3D TRUE;=0D HasUiSection =3D TRUE;=0D @@ -1211,7 +1204,6 @@ LibParseSection ( Level ++;=0D }=0D }=0D - NumberOfSections++;=0D EncapDataNeedUpdata =3D TRUE;=0D HasUiSection =3D TRUE;=0D //=0D @@ -1559,7 +1551,6 @@ LibParseSection ( //Leaf sections=0D //=0D case EFI_SECTION_RAW:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D if (!ViewFlag) {=0D if (!*IsFfsGenerated) {=0D @@ -1570,7 +1561,6 @@ LibParseSection ( =0D break;=0D case EFI_SECTION_PE32:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D if (!ViewFlag) {=0D if (!*IsFfsGenerated) {=0D @@ -1581,7 +1571,6 @@ LibParseSection ( =0D break;=0D case EFI_SECTION_PIC:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D if (!ViewFlag) {=0D if (!*IsFfsGenerated) {=0D @@ -1592,7 +1581,6 @@ LibParseSection ( =0D break;=0D case EFI_SECTION_TE:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D if (!ViewFlag) {=0D if (!*IsFfsGenerated) {=0D @@ -1603,7 +1591,6 @@ LibParseSection ( break;=0D =0D case EFI_SECTION_COMPATIBILITY16:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D if (!ViewFlag) {=0D if (!*IsFfsGenerated) {=0D @@ -1614,7 +1601,6 @@ LibParseSection ( break;=0D =0D case EFI_SECTION_FREEFORM_SUBTYPE_GUID:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D if (!ViewFlag) {=0D if (!*IsFfsGenerated) {=0D @@ -1625,11 +1611,9 @@ LibParseSection ( break;=0D =0D case EFI_SECTION_VERSION:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D break;=0D case EFI_SECTION_PEI_DEPEX:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D HasDepexSection =3D TRUE;=0D CurrentFv->FfsAttuibutes[*FfsCount].PeiDepex =3D malloc (SectionLeng= th);=0D @@ -1637,7 +1621,6 @@ LibParseSection ( CurrentFv->FfsAttuibutes[*FfsCount].PeiDepexLen =3D SectionLength;=0D break;=0D case EFI_SECTION_DXE_DEPEX:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D HasDepexSection =3D TRUE;=0D CurrentFv->FfsAttuibutes[*FfsCount].DxeDepex =3D malloc (SectionLeng= th);=0D @@ -1645,7 +1628,6 @@ LibParseSection ( CurrentFv->FfsAttuibutes[*FfsCount].DxeDepexLen =3D SectionLength;=0D break;=0D case EFI_SECTION_SMM_DEPEX:=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D HasDepexSection =3D TRUE;=0D CurrentFv->FfsAttuibutes[*FfsCount].SmmDepex =3D malloc (SectionLeng= th);=0D @@ -1655,7 +1637,6 @@ LibParseSection ( =0D case EFI_SECTION_USER_INTERFACE:=0D HasUiSection =3D TRUE;=0D - NumberOfSections ++;=0D CurrentFv->FfsAttuibutes[*FfsCount].Level =3D Level;=0D =0D UiSectionLength =3D GetLength (((EFI_USER_INTERFACE_SECTION *) Ptr)-= >CommonHeader.Size);=0D @@ -2186,7 +2167,6 @@ LibGetFvInfo ( )=0D {=0D EFI_STATUS Status;=0D - UINTN NumberOfFiles;=0D BOOLEAN ErasePolarity;=0D UINTN FvSize;=0D EFI_FFS_FILE_HEADER2 *CurrentFile;=0D @@ -2196,7 +2176,6 @@ LibGetFvInfo ( EFI_FIRMWARE_VOLUME_HEADER *FvHdr;=0D UINT8 PreFvId;=0D =0D - NumberOfFiles =3D 0;=0D Key =3D 0;=0D LocalEncapData =3D NULL;=0D CurrentFile =3D NULL;=0D @@ -2382,11 +2361,6 @@ LibGetFvInfo ( =0D while (CurrentFile !=3D NULL) {=0D =0D - //=0D - // Increment the number of files counter=0D - //=0D - NumberOfFiles++;=0D -=0D //=0D // Store FFS file Header information=0D //=0D --=20 2.40.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119802): https://edk2.groups.io/g/devel/message/119802 Mute This Topic: https://groups.io/mt/107051142/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-