]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/ArmVirtPlatformLib: 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:33 +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/ArmVirtPlatformLib/Virt.c

index 7a0fc0e75e37c6c48709c1df2e9fc95eaa0ed321..fcaf3c681a977ca72c96dcd418e6675942095adb 100644 (file)
@@ -70,13 +70,14 @@ ArmPlatformInitializeSystemMemory (
   VOID\r
   )\r
 {\r
-  VOID         *DeviceTreeBase;\r
-  INT32        Node, Prev;\r
-  UINT64       NewBase, CurBase;\r
-  UINT64       NewSize, CurSize;\r
-  CONST CHAR8  *Type;\r
-  INT32        Len;\r
-  CONST UINT64 *RegProp;\r
+  VOID          *DeviceTreeBase;\r
+  INT32         Node, Prev;\r
+  UINT64        NewBase, CurBase;\r
+  UINT64        NewSize, CurSize;\r
+  CONST CHAR8   *Type;\r
+  INT32         Len;\r
+  CONST UINT64  *RegProp;\r
+  RETURN_STATUS PcdStatus;\r
 \r
   NewBase = 0;\r
   NewSize = 0;\r
@@ -131,7 +132,8 @@ ArmPlatformInitializeSystemMemory (
   // Make sure the start of DRAM matches our expectation\r
   //\r
   ASSERT (FixedPcdGet64 (PcdSystemMemoryBase) == NewBase);\r
-  PcdSet64 (PcdSystemMemorySize, NewSize);\r
+  PcdStatus = PcdSet64S (PcdSystemMemorySize, NewSize);\r
+  ASSERT_RETURN_ERROR (PcdStatus);\r
 \r
   //\r
   // We need to make sure that the machine we are running on has at least\r