From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id BD5AD1A1E2D for ; Mon, 5 Sep 2016 04:44:13 -0700 (PDT) Received: by mail-it0-x22a.google.com with SMTP id e124so142246472ith.0 for ; Mon, 05 Sep 2016 04:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uShE9zcg+FEaTzv9haA2g5sNt/fFqIDaE0S3gc65cH4=; b=cklB5pMbTteZSK3viUgTngDj/+7BxSYYMqhbevLN55YqDlmCeqYpddk7CNy2cGsg4w RJPNTe0U3C/XNHcOxvSVCjtX8OujRlOIlg0E5fVZAKBs6IPgtMZEZHFXAY2B2fDIUQ5l J1uV+KV1KFSoRfp+LIPABSRt1C2kw3+twMgcI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uShE9zcg+FEaTzv9haA2g5sNt/fFqIDaE0S3gc65cH4=; b=Lijya0TY4coidYQsl0rq4118xplyZEpgkUUndp4nKejj2yDXaXugzIzHqDA4zta1+P Pv00ARuD6V66P/g4b+2buubBNZE/ZUzOu3bNZWNrxwVHyOWeXFWkolOx46ygfEe6+uXM NOxm/5Lf5DqeZSdlX+iT3Oahs9KESHCtS26998B6xuw5aXNhEmfMmUUCtanDhuCBrY2R 1nIGmnXc3cQztYYBP5VCS4ldXprlwnmFO/obSTm16bgrnv8bFyTcOrIu6UPc42HxYUKn w9nPFH6ut3n7cqbbYJeg63BPLLfN0U1JzlkOJlZ6/I1p1gUhV7ow3mszYHM/ifvbG7xx /5zQ== X-Gm-Message-State: AE9vXwNuvJvrUsQ86ulVe6PULQSFkoskyG8jkbySxA8ycEr9cn1x/f/HuMXjwzu2VE9S8CdYFGjp8k6Zwf2X7FlY X-Received: by 10.36.34.204 with SMTP id o195mr21847680ito.29.1473075853019; Mon, 05 Sep 2016 04:44:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.204.195 with HTTP; Mon, 5 Sep 2016 04:44:12 -0700 (PDT) In-Reply-To: References: <1473062175-1567-1-git-send-email-ard.biesheuvel@linaro.org> From: Ard Biesheuvel Date: Mon, 5 Sep 2016 12:44:12 +0100 Message-ID: To: Laszlo Ersek Cc: "edk2-devel@lists.01.org" Subject: Re: [PATCH] ArmVirtPkg/FdtPciPcdProducerLib: zero init local var to please GCC 4.8 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2016 11:44:14 -0000 Content-Type: text/plain; charset=UTF-8 On 5 September 2016 at 12:41, Laszlo Ersek 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 >> --- >> 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 > Pushed, thanks.