]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/ArmVirtPL031FdtClientLib: eliminate unchecked PcdSetXX() calls
authorLaszlo Ersek <lersek@redhat.com>
Fri, 21 Oct 2016 09:59:36 +0000 (11:59 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 25 Oct 2016 08:46:32 +0000 (10:46 +0200)
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>
ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.c

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