summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/Library
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2020-03-25 10:30:07 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-03-26 08:09:53 +0000
commitf52b30e73ddee9a3a609a6e5aa87e79cf4f50879 (patch)
tree1b02238794b1371efa5154cd597bf163765838b7 /ArmVirtPkg/Library
parent92a1ac40809e0886ac5c53864993e268b515674c (diff)
downloadedk2-f52b30e73ddee9a3a609a6e5aa87e79cf4f50879.tar.gz
edk2-f52b30e73ddee9a3a609a6e5aa87e79cf4f50879.tar.bz2
edk2-f52b30e73ddee9a3a609a6e5aa87e79cf4f50879.zip
ArmVirtPkg/PlatformPeiLib: add dummy assignment to work around older GCC
Older GCC (<= 4.9) fail to infer that Parent is never used unless it has been assigned before, and may throw an error like /work/git/edk2/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c: In function ‘PlatformPeim’: /work/git/edk2/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c:132:24: error: ‘Parent’ may be used uninitialized in this function [-Werror=maybe-uninitialized] RangesProp = fdt_getprop (Base, Parent, "ranges", &RangesLen); Set Parent to 0 at the start of the sequence to work around this. Link: https://bugzilla.tianocore.org/show_bug.cgi?id=2601 Fixes: 82662a3b5f56e974 ("ArmVirtPkg/PlatformPeiLib: discover the TPM base ...") Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'ArmVirtPkg/Library')
-rw-r--r--ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c b/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c
index 8b5b3dd5dc..6c4028e179 100644
--- a/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c
+++ b/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.c
@@ -77,6 +77,11 @@ PlatformPeim (
TpmBase = 0;
+ //
+ // Set Parent to suppress incorrect compiler/analyzer warnings.
+ //
+ Parent = 0;
+
for (Prev = Depth = 0;; Prev = Node) {
Node = fdt_next_node (Base, Prev, &Depth);
if (Node < 0) {