[edk2-devel] [PATCH edk2-platforms v1 2/2] TigerlakeOpenBoardPkg: Fix build error with GCC5

Takuto Naito posted 2 patches 4 years, 11 months ago
[edk2-devel] [PATCH edk2-platforms v1 2/2] TigerlakeOpenBoardPkg: Fix build error with GCC5
Posted by Takuto Naito 4 years, 11 months ago
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3224

Fix build errors caused by "-Werror=unused-but-set-variable" with GCC5.
These build errors occur only with DEBUG target because
RELEASE_GCC5_X64_CC_FLAGS has "-Wno-unused-but-set-variable",
but DEBUG_GCC5_X64_CC_FLAGS doesn't.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Heng Luo <heng.luo@intel.com>
Signed-off-by: Takuto Naito <naitaku@gmail.com>
---
 .../Library/BasePlatformHookLib/BasePlatformHookLib.c     | 8 --------
 .../Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c  | 2 ++
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c
index cc5337698b..0baee8795d 100644
--- a/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c
@@ -182,14 +182,6 @@ PlatformHookSerialPortInitialize (
   VOID
   )
 {
-  UINT16  IndexPort;
-  UINT16  DataPort;
-  UINT8   Index;
-
-  IndexPort = 0;
-  DataPort = 0;
-  Index = 0;
-
   //
   // Enable I/O decoding for COM1(3F8h-3FFh), COM2(2F8h-2FFh), I/O port 2Eh/2Fh, 4Eh/4Fh, 60h/64Fh and 62h/66h.
   //
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c
index 2ad229c1cd..0bba41e6d4 100644
--- a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c
@@ -393,6 +393,7 @@ TigerlakeURvpInitPreMem (
   /// Performing PlatformInitPreMemCallBack after PeiReadOnlyVariable2 PPI produced
   ///
   Status = PeiServicesNotifyPpi (&mPreMemNotifyList);
+  ASSERT_EFI_ERROR (Status);
 
   ///
   /// After code reorangized, memorycallback will run because the PPI is already
@@ -400,6 +401,7 @@ TigerlakeURvpInitPreMem (
   /// done before.
   ///
   Status = PeiServicesNotifyPpi (&mMemDiscoveredNotifyList);
+  ASSERT_EFI_ERROR (Status);
 
   DEBUG ((DEBUG_INFO, "TigerlakeURvpInitPreMem End!\n"));
 
-- 
2.30.1



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


Re: [edk2-devel] [PATCH edk2-platforms v1 2/2] TigerlakeOpenBoardPkg: Fix build error with GCC5
Posted by Heng Luo 4 years, 11 months ago
Reviewed-by: Heng Luo <heng.luo@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Takuto
> Naito
> Sent: Wednesday, February 24, 2021 9:38 AM
> To: devel@edk2.groups.io
> Cc: Takuto Naito <naitaku@gmail.com>; Chaganty, Rangasai V
> <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Luo, Heng <heng.luo@intel.com>
> Subject: [edk2-devel] [PATCH edk2-platforms v1 2/2] TigerlakeOpenBoardPkg:
> Fix build error with GCC5
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3224
> 
> Fix build errors caused by "-Werror=unused-but-set-variable" with GCC5.
> These build errors occur only with DEBUG target because
> RELEASE_GCC5_X64_CC_FLAGS has "-Wno-unused-but-set-variable", but
> DEBUG_GCC5_X64_CC_FLAGS doesn't.
> 
> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Heng Luo <heng.luo@intel.com>
> Signed-off-by: Takuto Naito <naitaku@gmail.com>
> ---
>  .../Library/BasePlatformHookLib/BasePlatformHookLib.c     | 8 --------
>  .../Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c  | 2 ++
>  2 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/Base
> PlatformHookLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/Bas
> ePlatformHookLib.c
> index cc5337698b..0baee8795d 100644
> ---
> a/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/Base
> PlatformHookLib.c
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/B
> +++ asePlatformHookLib.c
> @@ -182,14 +182,6 @@ PlatformHookSerialPortInitialize (
>    VOID
>    )
>  {
> -  UINT16  IndexPort;
> -  UINT16  DataPort;
> -  UINT8   Index;
> -
> -  IndexPort = 0;
> -  DataPort = 0;
> -  Index = 0;
> -
>    //
>    // Enable I/O decoding for COM1(3F8h-3FFh), COM2(2F8h-2FFh), I/O port
> 2Eh/2Fh, 4Eh/4Fh, 60h/64Fh and 62h/66h.
>    //
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLi
> b/PeiTigerlakeURvpInitPreMemLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLi
> b/PeiTigerlakeURvpInitPreMemLib.c
> index 2ad229c1cd..0bba41e6d4 100644
> ---
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLi
> b/PeiTigerlakeURvpInitPreMemLib.c
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardIn
> +++ itLib/PeiTigerlakeURvpInitPreMemLib.c
> @@ -393,6 +393,7 @@ TigerlakeURvpInitPreMem (
>    /// Performing PlatformInitPreMemCallBack after PeiReadOnlyVariable2 PPI
> produced
>    ///
>    Status = PeiServicesNotifyPpi (&mPreMemNotifyList);
> +  ASSERT_EFI_ERROR (Status);
> 
>    ///
>    /// After code reorangized, memorycallback will run because the PPI is
> already @@ -400,6 +401,7 @@ TigerlakeURvpInitPreMem (
>    /// done before.
>    ///
>    Status = PeiServicesNotifyPpi (&mMemDiscoveredNotifyList);
> +  ASSERT_EFI_ERROR (Status);
> 
>    DEBUG ((DEBUG_INFO, "TigerlakeURvpInitPreMem End!\n"));
> 
> --
> 2.30.1
> 
> 
> 
> 
> 



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