diff mbox

[Linaro-uefi] Platforms/ARM/Juno: fix RELEASE build with new PciHostBridgeLib

Message ID 20170412204850.29102-1-leif.lindholm@linaro.org
State Accepted
Commit 04a2f5be71bca8576612d4731d8bf3e1b5dbf464
Headers show

Commit Message

Leif Lindholm April 12, 2017, 8:48 p.m. UTC
An array of static strings is set up for use in printing debug messages.
This makes some compilers unhappy when building in RELEASE mode. So hide
the definition behind #ifndef MDE_NDEBUG.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
---
 Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Ard Biesheuvel April 13, 2017, 7:31 a.m. UTC | #1
On 12 April 2017 at 21:48, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> An array of static strings is set up for use in printing debug messages.
> This makes some compilers unhappy when building in RELEASE mode. So hide
> the definition behind #ifndef MDE_NDEBUG.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---
>  Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c b/Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c
> index f5cb254465..5263a2985d 100644
> --- a/Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c
> +++ b/Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c
> @@ -138,9 +138,11 @@ PciHostBridgeFreeRootBridges (
>  }
>
>
> +#ifndef MDEPKG_NDEBUG
>  STATIC CONST CHAR16 mPciHostBridgeLibAcpiAddressSpaceTypeStr[][4] = {
>    L"Mem", L"I/O", L"Bus"
>  };
> +#endif
>
>  /**
>    Inform the platform that the resource conflict happens.
> --
> 2.11.0
>
Leif Lindholm April 13, 2017, 10:03 a.m. UTC | #2
On Thu, Apr 13, 2017 at 08:31:19AM +0100, Ard Biesheuvel wrote:
> On 12 April 2017 at 21:48, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> > An array of static strings is set up for use in printing debug messages.
> > This makes some compilers unhappy when building in RELEASE mode. So hide
> > the definition behind #ifndef MDE_NDEBUG.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> 
> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Thanks - this and the AMD typedef fix pushed as 0844e1b..04a2f5b.

> > ---
> >  Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c b/Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c
> > index f5cb254465..5263a2985d 100644
> > --- a/Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c
> > +++ b/Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c
> > @@ -138,9 +138,11 @@ PciHostBridgeFreeRootBridges (
> >  }
> >
> >
> > +#ifndef MDEPKG_NDEBUG
> >  STATIC CONST CHAR16 mPciHostBridgeLibAcpiAddressSpaceTypeStr[][4] = {
> >    L"Mem", L"I/O", L"Bus"
> >  };
> > +#endif
> >
> >  /**
> >    Inform the platform that the resource conflict happens.
> > --
> > 2.11.0
> >
diff mbox

Patch

diff --git a/Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c b/Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c
index f5cb254465..5263a2985d 100644
--- a/Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c
+++ b/Platforms/ARM/Juno/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.c
@@ -138,9 +138,11 @@  PciHostBridgeFreeRootBridges (
 }
 
 
+#ifndef MDEPKG_NDEBUG
 STATIC CONST CHAR16 mPciHostBridgeLibAcpiAddressSpaceTypeStr[][4] = {
   L"Mem", L"I/O", L"Bus"
 };
+#endif
 
 /**
   Inform the platform that the resource conflict happens.