[edk2-devel] [edk2-staging][PATCH v2] BaseTools/Fmmt: Fixed FMMT Linux build break issue

fengyunhua posted 1 patch 1 week ago
Failed in applying to current master (apply log)
BaseTools/Source/C/FMMT/FirmwareModuleManagement.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)

[edk2-devel] [edk2-staging][PATCH v2] BaseTools/Fmmt: Fixed FMMT Linux build break issue

Posted by fengyunhua 1 week ago
Remove some defined variable but not used.
Linux build option[-Werror=unused-but-set-variable] treat all warnings  as errors.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>

Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn>
---
 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




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#66200): https://edk2.groups.io/g/devel/message/66200
Mute This Topic: https://groups.io/mt/77498244/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [edk2-staging][PATCH v2] BaseTools/Fmmt: Fixed FMMT Linux build break issue

Posted by Bob Feng 1 week ago
This patch looks good.

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: Yunhua Feng <fengyunhua@byosoft.com.cn> 
Sent: Wednesday, October 14, 2020 10:49 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>
Subject: [edk2-staging][PATCH v2] BaseTools/Fmmt: Fixed FMMT Linux build break issue

Remove some defined variable but not used.
Linux build option[-Werror=unused-but-set-variable] treat all warnings  as errors.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>

Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn>
---
 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




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#66201): https://edk2.groups.io/g/devel/message/66201
Mute This Topic: https://groups.io/mt/77498244/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


回复: [edk2-devel] [edk2-staging][PATCH v2] BaseTools/Fmmt: Fixed FMMT Linux build break issue

Posted by gaoliming 1 week ago
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: bounce+27952+66201+4905953+8761045@groups.io
> <bounce+27952+66201+4905953+8761045@groups.io> 代表 Bob Feng
> 发送时间: 2020年10月14日 11:11
> 收件人: Yunhua Feng <fengyunhua@byosoft.com.cn>; devel@edk2.groups.io
> 抄送: Liming Gao <gaoliming@byosoft.com.cn>
> 主题: Re: [edk2-devel] [edk2-staging][PATCH v2] BaseTools/Fmmt: Fixed
> FMMT Linux build break issue
> 
> This patch looks good.
> 
> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
> 
> -----Original Message-----
> From: Yunhua Feng <fengyunhua@byosoft.com.cn>
> Sent: Wednesday, October 14, 2020 10:49 AM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>
> Subject: [edk2-staging][PATCH v2] BaseTools/Fmmt: Fixed FMMT Linux build
> break issue
> 
> Remove some defined variable but not used.
> Linux build option[-Werror=unused-but-set-variable] treat all warnings  as
> errors.
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> 
> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn>
> ---
>  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
> 
> 
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#66202): https://edk2.groups.io/g/devel/message/66202
Mute This Topic: https://groups.io/mt/77499712/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [edk2-staging][PATCH v2] BaseTools/Fmmt: Fixed FMMT Linux build break issue

Posted by Bob Feng 1 week ago
This patch was pushed at f6d0a6fe01

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of gaoliming
Sent: Wednesday, October 14, 2020 1:07 PM
To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>; 'Yunhua Feng' <fengyunhua@byosoft.com.cn>
Subject: 回复: [edk2-devel] [edk2-staging][PATCH v2] BaseTools/Fmmt: Fixed FMMT Linux build break issue

Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: bounce+27952+66201+4905953+8761045@groups.io
> <bounce+27952+66201+4905953+8761045@groups.io> 代表 Bob Feng
> 发送时间: 2020年10月14日 11:11
> 收件人: Yunhua Feng <fengyunhua@byosoft.com.cn>; devel@edk2.groups.io
> 抄送: Liming Gao <gaoliming@byosoft.com.cn>
> 主题: Re: [edk2-devel] [edk2-staging][PATCH v2] BaseTools/Fmmt: Fixed 
> FMMT Linux build break issue
> 
> This patch looks good.
> 
> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
> 
> -----Original Message-----
> From: Yunhua Feng <fengyunhua@byosoft.com.cn>
> Sent: Wednesday, October 14, 2020 10:49 AM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao 
> <gaoliming@byosoft.com.cn>
> Subject: [edk2-staging][PATCH v2] BaseTools/Fmmt: Fixed FMMT Linux 
> build break issue
> 
> Remove some defined variable but not used.
> Linux build option[-Werror=unused-but-set-variable] treat all warnings  
> as errors.
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> 
> Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn>
> ---
>  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
> 
> 
> 
> 
> 
> 










-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#66228): https://edk2.groups.io/g/devel/message/66228
Mute This Topic: https://groups.io/mt/77519142/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-