]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/FdtPciPcdProducerLib: zero init local var to please GCC 4.8
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 5 Sep 2016 07:52:11 +0000 (08:52 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 5 Sep 2016 11:42:46 +0000 (12:42 +0100)
GCC 4.8 in RELEASE mode complains about GetPciIoTranslation () potentially
not assigning IoTranslation, but does not notice that it returns failure in
this case, which means IoTranslation is never referenced *unless* it has
been assigned. So simply set IoTranslation to zero to help the compiler.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c

index 10b47560cb9cbee3aac82206e8434ba35664b86f..ea27cda7b77cf7a4fd6e02e3084f6a2cbfc6c9a6 100644 (file)
@@ -128,6 +128,7 @@ FdtPciPcdProducerLibConstructor (
 \r
       PcdSetBool (PcdPciDisableBusEnumeration, FALSE);\r
 \r
+      IoTranslation = 0;\r
       RetStatus = GetPciIoTranslation (FdtClient, Node, &IoTranslation);\r
       if (!RETURN_ERROR (RetStatus)) {\r
           PcdSet64 (PcdPciIoTranslation, IoTranslation);\r