public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Laszlo Ersek <lersek@redhat.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@ml01.01.org>
Subject: Re: [PATCH] ArmVirtPkg/FdtPciPcdProducerLib: zero init local var to please GCC 4.8
Date: Mon, 5 Sep 2016 12:44:12 +0100	[thread overview]
Message-ID: <CAKv+Gu9aiVY4Qmp7AGQWhocwd4xmKJioMGG0N5djF3MeF8-zvw@mail.gmail.com> (raw)
In-Reply-To: <e3ce73e2-bef9-d5f6-5b16-0dc9dfaec624@redhat.com>

On 5 September 2016 at 12:41, Laszlo Ersek <lersek@redhat.com> wrote:
> On 09/05/16 09:56, Ard Biesheuvel wrote:
>> 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);
>>
>
> Ouch. This is exactly why "IoTranslation = 0" appeared at the beginning,
> in commit 65bb13b0fd7f ("ArmVirtualizationPkg/VirtFdtDxe: parse
> "pci-host-ecam-generic" properties"), and why we've been carrying it
> around, most recently in commit d4cb9a30494d ("ArmVirtPkg: implement
> FdtPciHostBridgeLib"). We forgot about it in commit c8f1a75aa997
> ("ArmVirtPkg/FdtPciPcdProducerLib: add handling of PcdPciIoTranslation").
>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
>

Pushed, thanks.


      reply	other threads:[~2016-09-05 11:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKv+Gu9aiVY4Qmp7AGQWhocwd4xmKJioMGG0N5djF3MeF8-zvw@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox