mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
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>
This commit is contained in:
parent
92a1ac4080
commit
f52b30e73d
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user