From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web10.2684.1602643822121292313 for ; Tue, 13 Oct 2020 19:50:23 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: fengyunhua@byosoft.com.cn) Received: from localhost.localdomain ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Wed, 14 Oct 2020 10:50:17 +0800 X-WM-Sender: fengyunhua@byosoft.com.cn From: "fengyunhua" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-staging][PATCH v2] BaseTools/Fmmt: Fixed FMMT Linux build break issue Date: Wed, 14 Oct 2020 10:49:29 +0800 Message-Id: <20201014024929.1945-1-fengyunhua@byosoft.com.cn> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Remove some defined variable but not used. Linux build option[-Werror=unused-but-set-variable] treat all warnings as errors. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yunhua Feng --- BaseTools/Source/C/FMMT/FirmwareModuleManagement.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/BaseTools/Source/C/FMMT/FirmwareModuleManagement.c b/BaseTools/Source/C/FMMT/FirmwareModuleManagement.c index 20663ba163..38056153fb 100644 --- a/BaseTools/Source/C/FMMT/FirmwareModuleManagement.c +++ b/BaseTools/Source/C/FMMT/FirmwareModuleManagement.c @@ -1717,11 +1717,6 @@ FmmtImageExtract ( FV_INFORMATION *FvInFd; UINT32 Index; UINT32 FfsFoundFlag; - FFS_INFORMATION *OutputFileName; - FILE* NewFdFile; - FILE* NewFvFile; - UINT64 NewFvLength; - VOID* Buffer; CHAR8 *TemDir; UINT8 FvNumInFd; UINT32 Offset; @@ -1736,23 +1731,18 @@ FmmtImageExtract ( UINT32 FfsSize; UINT32 FdSize; int j; - CHAR8 FfsOutputFileName[_MAX_DIR]; + CHAR8 FfsOutputFileName[_MAX_PATH]; FdSize = 0; Index = 0; - NewFvLength = 0; FfsFoundFlag = 0; FdData = NULL; FvInFd = NULL; - OutputFileName = NULL; - NewFdFile = NULL; - NewFvFile = NULL; - Buffer = NULL; TemDir = NULL; FvNumInFd = 0; Offset = 0; FdBuffer = NULL; - if (sizeof(FfsOutFileOrDirName) > _MAX_DIR) { + if (strlen(FfsOutFileOrDirName) > _MAX_PATH - 1) { Error("FMMT", 0, 0004, "error while input file name", "Output directory path is too long" ); return EFI_ABORTED; } -- 2.27.0.windows.1