ArmVirtPkg/ArmVirtPL031FdtClientLib: eliminate unchecked PcdSetXX() calls

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.biesheuvel@linaro.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=165
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> # RVCT
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
Laszlo Ersek 2016-10-21 11:59:36 +02:00
parent 65ebe6e6c9
commit a79d29b6d3
1 changed files with 3 additions and 1 deletions

View File

@ -34,6 +34,7 @@ ArmVirtPL031FdtClientLibConstructor (
CONST UINT64 *Reg;
UINT32 RegSize;
UINT64 RegBase;
RETURN_STATUS PcdStatus;
Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,
(VOID **)&FdtClient);
@ -60,7 +61,8 @@ ArmVirtPL031FdtClientLibConstructor (
RegBase = SwapBytes64 (Reg[0]);
ASSERT (RegBase < MAX_UINT32);
PcdSet32 (PcdPL031RtcBase, (UINT32)RegBase);
PcdStatus = PcdSet32S (PcdPL031RtcBase, (UINT32)RegBase);
ASSERT_RETURN_ERROR (PcdStatus);
DEBUG ((EFI_D_INFO, "Found PL031 RTC @ 0x%Lx\n", RegBase));