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

index 648806126e7807721275ebf403154f6f59b3a899..dc1f5155f1fc00862f99f54cc7eca251391499de 100644 (file)
@@ -41,6 +41,7 @@ ArmVirtGicArchLibConstructor (
   UINTN                 GicRevision;\r
   EFI_STATUS            Status;\r
   UINT64                DistBase, CpuBase, RedistBase;\r
+  RETURN_STATUS         PcdStatus;\r
 \r
   Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,\r
                   (VOID **)&FdtClient);\r
@@ -85,8 +86,10 @@ ArmVirtGicArchLibConstructor (
     RedistBase = SwapBytes64 (Reg[2]);\r
     ASSERT (RedistBase < MAX_UINTN);\r
 \r
-    PcdSet64 (PcdGicDistributorBase, DistBase);\r
-    PcdSet64 (PcdGicRedistributorsBase, RedistBase);\r
+    PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase);\r
+    ASSERT_RETURN_ERROR (PcdStatus);\r
+    PcdStatus = PcdSet64S (PcdGicRedistributorsBase, RedistBase);\r
+    ASSERT_RETURN_ERROR (PcdStatus);\r
 \r
     DEBUG ((EFI_D_INFO, "Found GIC v3 (re)distributor @ 0x%Lx (0x%Lx)\n",\r
       DistBase, RedistBase));\r
@@ -120,8 +123,10 @@ ArmVirtGicArchLibConstructor (
     ASSERT (DistBase < MAX_UINTN);\r
     ASSERT (CpuBase < MAX_UINTN);\r
 \r
-    PcdSet64 (PcdGicDistributorBase, DistBase);\r
-    PcdSet64 (PcdGicInterruptInterfaceBase, CpuBase);\r
+    PcdStatus = PcdSet64S (PcdGicDistributorBase, DistBase);\r
+    ASSERT_RETURN_ERROR (PcdStatus);\r
+    PcdStatus = PcdSet64S (PcdGicInterruptInterfaceBase, CpuBase);\r
+    ASSERT_RETURN_ERROR (PcdStatus);\r
 \r
     DEBUG ((EFI_D_INFO, "Found GIC @ 0x%Lx/0x%Lx\n", DistBase, CpuBase));\r
 \r