From: "Yuwei Chen" <yuwei.chen@intel.com>
To: "Kuo, Ted" <ted.kuo@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Liming Gao <gaoliming@byosoft.com.cn>,
"Feng, Bob C" <bob.c.feng@intel.com>
Subject: Re: [edk2-devel][PATCH][edk2-staging] BaseTools: Fix BaseTools compilation issues
Date: Fri, 12 Jul 2024 05:14:45 +0000 [thread overview]
Message-ID: <MW5PR11MB590608F9CAED94DED939F8F796A62@MW5PR11MB5906.namprd11.prod.outlook.com> (raw)
In-Reply-To: <1287dcdf308fe882db0ed2d229f8ea28434b3707.1720171761.git.ted.kuo@intel.com>
Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
> -----Original Message-----
> From: Kuo, Ted <ted.kuo@intel.com>
> Sent: Friday, July 5, 2024 5:32 PM
> To: devel@edk2.groups.io
> Cc: Liming Gao <gaoliming@byosoft.com.cn>; Feng, Bob C
> <bob.c.feng@intel.com>; Chen, Christine <yuwei.chen@intel.com>
> Subject: [edk2-devel][PATCH][edk2-staging] BaseTools: Fix BaseTools
> compilation issues
>
> https://bugzilla.tianocore.org/show_bug.cgi?id=4798
> 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 <gaoliming@byosoft.com.cn>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Signed-off-by: Ted Kuo <ted.kuo@intel.com>
> ---
> 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 (
> ) { - UINTN BytesRead; UINT32 Size;
> EFI_FV_BLOCK_MAP_ENTRY BlockMap; - BytesRead = 0; Size = 0; if
> (InputFile == NULL || FvSize == NULL) {@@ -377,7 +375,6 @@ LibGetFvSize (
> fseek (InputFile, sizeof (EFI_FIRMWARE_VOLUME_HEADER) - sizeof
> (EFI_FV_BLOCK_MAP_ENTRY), SEEK_CUR); do { fread (&BlockMap, sizeof
> (EFI_FV_BLOCK_MAP_ENTRY), 1, InputFile);- BytesRead += sizeof
> (EFI_FV_BLOCK_MAP_ENTRY); if (BlockMap.NumBlocks != 0) { Size +=
> BlockMap.NumBlocks * BlockMap.Length;@@ -1032,7 +1029,6 @@
> LibParseSection (
> CHAR16 *UIName; UINT32 UINameSize; BOOLEAN
> HasDepexSection;- UINT32 NumberOfSections; BOOLEAN
> IsFfsGenerated; ENCAP_INFO_DATA *LocalEncapData; CHAR8
> *BlankChar;@@ -1058,7 +1054,6 @@ LibParseSection (
> ParsedLength = 0; ToolOutputLength = 0; UINameSize
> = 0;- NumberOfSections = 0; UncompressedLength = 0;
> CompressedLength = 0; CompressionType = 0;@@ -1116,7
> +1111,6 @@ LibParseSection (
> EncapDataNeedUpdata = TRUE; Level ++;- NumberOfSections ++;
> CurrentFv->FfsAttuibutes[*FfsCount].IsLeaf = FALSE; @@ -1171,7 +1165,6 @@
> LibParseSection (
> case EFI_SECTION_COMPRESSION: Level ++;- NumberOfSections ++;
> EncapDataNeedUpdata = TRUE; //@@ -1317,7 +1310,6 @@
> LibParseSection (
> // a GUID defined FV section. // Level ++;- NumberOfSections++;
> EncapDataNeedUpdata = TRUE; //@@ -1583,7 +1575,6 @@
> LibParseSection (
> //Leaf sections // case EFI_SECTION_RAW:- NumberOfSections
> ++; CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag)
> { if (!IsFfsGenerated) {@@ -1594,7 +1585,6 @@ LibParseSection (
> break; case EFI_SECTION_PE32:- NumberOfSections ++;
> CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag) { if
> (!IsFfsGenerated) {@@ -1605,7 +1595,6 @@ LibParseSection (
> break; case EFI_SECTION_PIC:- NumberOfSections ++; CurrentFv-
> >FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag) { if
> (!IsFfsGenerated) {@@ -1616,7 +1605,6 @@ LibParseSection (
> break; case EFI_SECTION_TE:- NumberOfSections ++; CurrentFv-
> >FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag) { if
> (!IsFfsGenerated) {@@ -1627,7 +1615,6 @@ LibParseSection (
> break; case EFI_SECTION_COMPATIBILITY16:- NumberOfSections ++;
> CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag) {@@ -
> 1639,7 +1626,6 @@ LibParseSection (
> break; case EFI_SECTION_FREEFORM_SUBTYPE_GUID:-
> NumberOfSections ++; CurrentFv->FfsAttuibutes[*FfsCount].Level = Level;
> if (!ViewFlag) { if (!IsFfsGenerated) {@@ -1650,27 +1636,22 @@
> LibParseSection (
> break; case EFI_SECTION_VERSION:- NumberOfSections ++;
> CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; break; case
> EFI_SECTION_PEI_DEPEX:- NumberOfSections ++; CurrentFv-
> >FfsAttuibutes[*FfsCount].Level = Level; HasDepexSection = TRUE;
> break; case EFI_SECTION_DXE_DEPEX:- NumberOfSections ++;
> CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; HasDepexSection =
> TRUE; break; case EFI_SECTION_SMM_DEPEX:- NumberOfSections
> ++; CurrentFv->FfsAttuibutes[*FfsCount].Level = Level;
> HasDepexSection = TRUE; break; case EFI_SECTION_USER_INTERFACE:-
> NumberOfSections ++; CurrentFv->FfsAttuibutes[*FfsCount].Level = Level;
> UiSectionLength = FvBufExpand3ByteSize (((EFI_USER_INTERFACE_SECTION *)
> Ptr)->CommonHeader.Size);@@ -1975,7 +1956,6 @@ LibGetFvInfo (
> ) { EFI_STATUS Status;- UINTN NumberOfFiles;
> BOOLEAN ErasePolarity; UINTN FvSize;
> EFI_FFS_FILE_HEADER2 *CurrentFile;@@ -1983,7 +1963,6 @@
> LibGetFvInfo (
> ENCAP_INFO_DATA *LocalEncapData;
> EFI_FIRMWARE_VOLUME_EXT_HEADER *ExtHdrPtr; - NumberOfFiles = 0;
> Key = 0; LocalEncapData = NULL; CurrentFile = NULL;@@ -2147,11
> +2126,6 @@ LibGetFvInfo (
> while (CurrentFile != NULL) { - //- // Increment the number of files
> counter- //- NumberOfFiles++;- // // Store FFS file Header information
> //diff --git a/BaseTools/Source/C/FMMT/FmmtLib.c
> b/BaseTools/Source/C/FMMT/FmmtLib.c
> index e1436112ca..20e3e1acfc 100644
> --- a/BaseTools/Source/C/FMMT/FmmtLib.c
> +++ b/BaseTools/Source/C/FMMT/FmmtLib.c
> @@ -552,11 +552,9 @@ LibGetFvSize (
> ) { - UINTN BytesRead; UINT32 Size;
> EFI_FV_BLOCK_MAP_ENTRY BlockMap; - BytesRead = 0; Size = 0; if
> (InputFile == NULL || FvSize == NULL) {@@ -567,7 +565,6 @@ LibGetFvSize (
> fseek (InputFile, sizeof (EFI_FIRMWARE_VOLUME_HEADER) - sizeof
> (EFI_FV_BLOCK_MAP_ENTRY), SEEK_CUR); do { fread (&BlockMap, sizeof
> (EFI_FV_BLOCK_MAP_ENTRY), 1, InputFile);- BytesRead += sizeof
> (EFI_FV_BLOCK_MAP_ENTRY); if (BlockMap.NumBlocks != 0) { Size +=
> BlockMap.NumBlocks * BlockMap.Length;@@ -813,7 +810,6 @@
> LibParseSection (
> CHAR16 *UIName; UINT32 UINameSize; BOOLEAN
> HasDepexSection;- UINT32 NumberOfSections; ENCAP_INFO_DATA
> *LocalEncapData; ENCAP_INFO_DATA *LocalEncapDataTemp; CHAR8
> *BlankChar;@@ -846,7 +842,6 @@ LibParseSection (
> ParsedLength = 0; ToolOutputLength = 0; UINameSize
> = 0;- NumberOfSections = 0; UncompressedLength = 0;
> CompressedLength = 0; CompressionType = 0;@@ -910,7 +905,6
> @@ LibParseSection (
> HasUiSection = TRUE; Level ++;- NumberOfSections ++;
> CurrentFv->FfsAttuibutes[*FfsCount].IsLeaf = FALSE; CurrentFv-
> >FfsAttuibutes[*FfsCount].IsFvStart = TRUE;@@ -1021,7 +1015,6 @@
> LibParseSection (
> Level ++; } }- NumberOfSections ++;
> EncapDataNeedUpdata = TRUE; HasUiSection = TRUE;@@ -1211,7 +1204,6
> @@ LibParseSection (
> Level ++; } }- NumberOfSections++;
> EncapDataNeedUpdata = TRUE; HasUiSection = TRUE; //@@ -1559,7
> +1551,6 @@ LibParseSection (
> //Leaf sections // case EFI_SECTION_RAW:- NumberOfSections ++;
> CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag) { if
> (!*IsFfsGenerated) {@@ -1570,7 +1561,6 @@ LibParseSection (
> break; case EFI_SECTION_PE32:- NumberOfSections ++;
> CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag) { if
> (!*IsFfsGenerated) {@@ -1581,7 +1571,6 @@ LibParseSection (
> break; case EFI_SECTION_PIC:- NumberOfSections ++; CurrentFv-
> >FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag) { if
> (!*IsFfsGenerated) {@@ -1592,7 +1581,6 @@ LibParseSection (
> break; case EFI_SECTION_TE:- NumberOfSections ++; CurrentFv-
> >FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag) { if
> (!*IsFfsGenerated) {@@ -1603,7 +1591,6 @@ LibParseSection (
> break; case EFI_SECTION_COMPATIBILITY16:- NumberOfSections ++;
> CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; if (!ViewFlag) { if
> (!*IsFfsGenerated) {@@ -1614,7 +1601,6 @@ LibParseSection (
> break; case EFI_SECTION_FREEFORM_SUBTYPE_GUID:-
> NumberOfSections ++; CurrentFv->FfsAttuibutes[*FfsCount].Level = Level;
> if (!ViewFlag) { if (!*IsFfsGenerated) {@@ -1625,11 +1611,9 @@
> LibParseSection (
> break; case EFI_SECTION_VERSION:- NumberOfSections ++;
> CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; break; case
> EFI_SECTION_PEI_DEPEX:- NumberOfSections ++; CurrentFv-
> >FfsAttuibutes[*FfsCount].Level = Level; HasDepexSection = TRUE;
> CurrentFv->FfsAttuibutes[*FfsCount].PeiDepex = malloc (SectionLength);@@ -
> 1637,7 +1621,6 @@ LibParseSection (
> CurrentFv->FfsAttuibutes[*FfsCount].PeiDepexLen = SectionLength;
> break; case EFI_SECTION_DXE_DEPEX:- NumberOfSections ++;
> CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; HasDepexSection =
> TRUE; CurrentFv->FfsAttuibutes[*FfsCount].DxeDepex = malloc
> (SectionLength);@@ -1645,7 +1628,6 @@ LibParseSection (
> CurrentFv->FfsAttuibutes[*FfsCount].DxeDepexLen = SectionLength;
> break; case EFI_SECTION_SMM_DEPEX:- NumberOfSections ++;
> CurrentFv->FfsAttuibutes[*FfsCount].Level = Level; HasDepexSection =
> TRUE; CurrentFv->FfsAttuibutes[*FfsCount].SmmDepex = malloc
> (SectionLength);@@ -1655,7 +1637,6 @@ LibParseSection (
> case EFI_SECTION_USER_INTERFACE: HasUiSection = TRUE;-
> NumberOfSections ++; CurrentFv->FfsAttuibutes[*FfsCount].Level = Level;
> UiSectionLength = GetLength (((EFI_USER_INTERFACE_SECTION *) Ptr)-
> >CommonHeader.Size);@@ -2186,7 +2167,6 @@ LibGetFvInfo (
> ) { EFI_STATUS Status;- UINTN NumberOfFiles;
> BOOLEAN ErasePolarity; UINTN FvSize;
> EFI_FFS_FILE_HEADER2 *CurrentFile;@@ -2196,7 +2176,6 @@
> LibGetFvInfo (
> EFI_FIRMWARE_VOLUME_HEADER *FvHdr; UINT8 PreFvId; -
> NumberOfFiles = 0; Key = 0; LocalEncapData = NULL; CurrentFile =
> NULL;@@ -2382,11 +2361,6 @@ LibGetFvInfo (
> while (CurrentFile != NULL) { - //- // Increment the number of files
> counter- //- NumberOfFiles++;- // // Store FFS file Header information
> //--
> 2.40.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119904): https://edk2.groups.io/g/devel/message/119904
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]
-=-=-=-=-=-=-=-=-=-=-=-
prev parent reply other threads:[~2024-07-12 5:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-05 9:31 [edk2-devel][PATCH][edk2-staging] BaseTools: Fix BaseTools compilation issues Kuo, Ted
2024-07-12 5:14 ` Yuwei Chen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MW5PR11MB590608F9CAED94DED939F8F796A62@MW5PR11MB5906.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox