public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ArmVirtPkg/FdtPciPcdProducerLib: zero init local var to please GCC 4.8
@ 2016-09-05  7:56 Ard Biesheuvel
  2016-09-05 11:41 ` Laszlo Ersek
  0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2016-09-05  7:56 UTC (permalink / raw)
  To: edk2-devel, lersek; +Cc: Ard Biesheuvel

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>
---
 ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c b/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
index 10b47560cb9c..ea27cda7b77c 100644
--- a/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
+++ b/ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c
@@ -128,6 +128,7 @@ FdtPciPcdProducerLibConstructor (
 
       PcdSetBool (PcdPciDisableBusEnumeration, FALSE);
 
+      IoTranslation = 0;
       RetStatus = GetPciIoTranslation (FdtClient, Node, &IoTranslation);
       if (!RETURN_ERROR (RetStatus)) {
           PcdSet64 (PcdPciIoTranslation, IoTranslation);
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-05 11:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-05  7:56 [PATCH] ArmVirtPkg/FdtPciPcdProducerLib: zero init local var to please GCC 4.8 Ard Biesheuvel
2016-09-05 11:41 ` Laszlo Ersek
2016-09-05 11:44   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox