diff options
author | Laszlo Ersek <lersek@redhat.com> | 2016-10-21 11:59:36 +0200 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2016-10-25 10:46:35 +0200 |
commit | 537eb0722b205671237b22e7e8785ce47e93c4d4 (patch) | |
tree | da0c8e808fb8ee8c2c8f9e3b93719b8f5e1fceb6 /ArmVirtPkg/Library/ArmVirtTimerFdtClientLib | |
parent | a9f63d697f6959772618691eda252d99c207b6c0 (diff) | |
download | edk2-537eb0722b205671237b22e7e8785ce47e93c4d4.zip edk2-537eb0722b205671237b22e7e8785ce47e93c4d4.tar.gz edk2-537eb0722b205671237b22e7e8785ce47e93c4d4.tar.bz2 |
ArmVirtPkg/ArmVirtTimerFdtClientLib: 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>
Diffstat (limited to 'ArmVirtPkg/Library/ArmVirtTimerFdtClientLib')
-rw-r--r-- | ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c b/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c index 6e7461c..c408386 100644 --- a/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c +++ b/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c @@ -41,6 +41,7 @@ ArmVirtTimerFdtClientLibConstructor ( CONST INTERRUPT_PROPERTY *InterruptProp;
UINT32 PropSize;
INT32 SecIntrNum, IntrNum, VirtIntrNum, HypIntrNum;
+ RETURN_STATUS PcdStatus;
Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,
(VOID **)&FdtClient);
@@ -78,10 +79,14 @@ ArmVirtTimerFdtClientLibConstructor ( DEBUG ((EFI_D_INFO, "Found Timer interrupts %d, %d, %d, %d\n",
SecIntrNum, IntrNum, VirtIntrNum, HypIntrNum));
- PcdSet32 (PcdArmArchTimerSecIntrNum, SecIntrNum);
- PcdSet32 (PcdArmArchTimerIntrNum, IntrNum);
- PcdSet32 (PcdArmArchTimerVirtIntrNum, VirtIntrNum);
- PcdSet32 (PcdArmArchTimerHypIntrNum, HypIntrNum);
+ PcdStatus = PcdSet32S (PcdArmArchTimerSecIntrNum, SecIntrNum);
+ ASSERT_RETURN_ERROR (PcdStatus);
+ PcdStatus = PcdSet32S (PcdArmArchTimerIntrNum, IntrNum);
+ ASSERT_RETURN_ERROR (PcdStatus);
+ PcdStatus = PcdSet32S (PcdArmArchTimerVirtIntrNum, VirtIntrNum);
+ ASSERT_RETURN_ERROR (PcdStatus);
+ PcdStatus = PcdSet32S (PcdArmArchTimerHypIntrNum, HypIntrNum);
+ ASSERT_RETURN_ERROR (PcdStatus);
return EFI_SUCCESS;
}
|