On 21 October 2016 at 22:27, Laszlo Ersek <ler...@redhat.com> wrote:
> These are deprecated / disabled under the
> DISABLE_NEW_DEPRECATED_INTERFACES feature test macro.
>
> Introduce a variable called PcdStatus, and use it to assert the success of
> these operations (there is no reason for them to fail here).
>
> Cc: Ard Biesheuvel <ard.biesheu...@linaro.org>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=165
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Laszlo Ersek <ler...@redhat.com>

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

> ---
>  ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c 
> b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
> index 648806126e78..dc1f5155f1fc 100644
> --- a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
> +++ b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
> @@ -41,6 +41,7 @@ ArmVirtGicArchLibConstructor (
>    UINTN                 GicRevision;
>    EFI_STATUS            Status;
>    UINT64                DistBase, CpuBase, RedistBase;
> +  RETURN_STATUS         PcdStatus;
>
>    Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,
>                    (VOID **)&FdtClient);
> @@ -85,8 +86,10 @@ ArmVirtGicArchLibConstructor (
>      RedistBase = SwapBytes64 (Reg[2]);
>      ASSERT (RedistBase < MAX_UINTN);
>
> -    PcdSet64 (PcdGicDistributorBase, DistBase);
> -    PcdSet64 (PcdGicRedistributorsBase, RedistBase);
> +    PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase);
> +    ASSERT_RETURN_ERROR (PcdStatus);
> +    PcdStatus = PcdSet64S (PcdGicRedistributorsBase, RedistBase);
> +    ASSERT_RETURN_ERROR (PcdStatus);
>
>      DEBUG ((EFI_D_INFO, "Found GIC v3 (re)distributor @ 0x%Lx (0x%Lx)\n",
>        DistBase, RedistBase));
> @@ -120,8 +123,10 @@ ArmVirtGicArchLibConstructor (
>      ASSERT (DistBase < MAX_UINTN);
>      ASSERT (CpuBase < MAX_UINTN);
>
> -    PcdSet64 (PcdGicDistributorBase, DistBase);
> -    PcdSet64 (PcdGicInterruptInterfaceBase, CpuBase);
> +    PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase);
> +    ASSERT_RETURN_ERROR (PcdStatus);
> +    PcdStatus = PcdSet64S (PcdGicInterruptInterfaceBase, CpuBase);
> +    ASSERT_RETURN_ERROR (PcdStatus);
>
>      DEBUG ((EFI_D_INFO, "Found GIC @ 0x%Lx/0x%Lx\n", DistBase, CpuBase));
>
> --
> 2.9.2
>
>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to