From patchwork Tue Jun 20 11:00:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 105997 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1305426qgd; Tue, 20 Jun 2017 04:02:13 -0700 (PDT) X-Received: by 10.99.106.2 with SMTP id f2mr31657371pgc.46.1497956533522; Tue, 20 Jun 2017 04:02:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497956533; cv=none; d=google.com; s=arc-20160816; b=H6edDI7kfT+wHNW8eIAVkrvPXCBEkk8wJS6ftbJFYIy46N+5l7UIyQ6WoemgIk3S9y 8P5o15aWYBAvAaAFuykekfHTecpV0PzoYhpVIvi+NDJFc+LqevLoaffGenjY2NSdFRlA 5X8NXcxYKML0WmgyTGIzWXkK77dK2NdReqHetIbkMs3xB8gCjxpu5rN7JvSNYbn2HMaj Kj1Y5pf5b2DrAnFnOAsm6keK/SDm5UkOaFftGvdHkz9D5SpQld0HOXf4nrTleZtqqll6 w3xgat46nXyfq/JNQraN1I9c/IHu+nTb2txIjo8BdgRup6NwSsH0nk5JouS2RtQNP5yJ 3cLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=srl4FVU6pVx3YhhhFxjF6VUBh018Vl/VdjJuZTLnqS4=; b=OOAroRDjep/Uf/aa8nVyDBs1PP0amuSOCQKUBjtSKCyfkrdAYfO0K2hij7PnzsDnLU UTEIg9wAhybPOXxp5wjNc4r6Bfs8AJS7lMhfvCnepFH16ES1IDLDRTXhLcQmfQX7AyHp ekO7jzV5cFX4+BwaMqpok5azVPz+THpuwlkpnxfkb2TSO/LPELf8HFOCOMmLGC1kvGw/ O0HPgu/RSLL1Z9+IeoeZujFIFCWbIqEhEROBVxBaaXZxR6zQzBAx8MDZuQ92skiq4sj5 RMYMd6vFM/4w4IEwVvlwUFd5FrBg23Nk90G/MWZd0y83yaLYRIYcdnoWbrsh+XkpFfDS go7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=LyjOS2Dt; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id r8si10245590pgr.331.2017.06.20.04.02.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 04:02:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=LyjOS2Dt; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C735C21C8F61C; Tue, 20 Jun 2017 04:00:49 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (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 811C521BB2527 for ; Tue, 20 Jun 2017 04:00:48 -0700 (PDT) Received: by mail-wm0-x231.google.com with SMTP id m125so18290206wmm.1 for ; Tue, 20 Jun 2017 04:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZZudXzyNBow8fuwhyOa9yeA98jLXHc8IFnIR6pyxAWU=; b=LyjOS2DtAarbutkfshHvPXjpveU9RMkbcf5oBRg5CdcGHEMAZQQWhnukz2XXItC+Nn m9tj7sOtmKXRAS5vNo8PVifAnDQfp41rWceX6Kkiq1fujqNNsFMph1duLHXQLhEg54Cm xbuM2ug5czwt+YFC9R4+aRTUPcB4M2FLnB05w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZZudXzyNBow8fuwhyOa9yeA98jLXHc8IFnIR6pyxAWU=; b=dVmIdPYGsBy4z/Ox2kcxiYVzcftOnHSA6dZWcLfg5MqMKcvzAZ/+EZyKNodOx6XltO nd/wRVQJUaWyaelvAbTE1lwebrUKidc3a0aPvcOlNTt6acYlbXWiQYNzdd7Uoszam5Vc B2Jm610V23cXU/S3SoFfylmpmZr7x8OAmj2iSLqJBn2NeZNM5MetRlRBrBq+QtYgeald fDbI4hJDTmIJPNJMVTsLZQLzcCZzWyUFJFYvtq2mwH2/E6MvuODl1CgZddLerO3XCWwr b6BgRkRMo/ztqPOskN8FmU+8qt6Rw8WXHU7hGFdJbO9iEkVZEv7CAuhxk7Q7kEzeRB/X 1KoQ== X-Gm-Message-State: AKS2vOw2KHQ/wKQRMMxDkx1+bsRzqmxSh5V4f8DhyTX0zubCu/RiXouG jsG4jeFnWAmf/wQ2wPg5Og== X-Received: by 10.28.103.193 with SMTP id b184mr2482038wmc.25.1497956529535; Tue, 20 Jun 2017 04:02:09 -0700 (PDT) Received: from mohikan.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id w128sm6398198wmd.7.2017.06.20.04.02.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 04:02:09 -0700 (PDT) From: Leif Lindholm To: edk2-devel@lists.01.org Date: Tue, 20 Jun 2017 12:00:08 +0100 Message-Id: <20170620110008.24413-1-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [edk2] [PATCH] ArmPlatformPkg: eliminate Juno gcc build warning X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ryan.harkin@linaro.org, ard.biesheuvel@linaro.org Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" When building without LTO, gcc incorrectly resolves the hazards for 'PciRegBase’ when inlining, leading to "may be used uninitialized" warnings (and hence build failure with -Werror). Eliminate this warning by explicitly initializing the variable to 0. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm Reviewed-by: Ard Biesheuvel Reviewed-by: Ryan Harkin --- For those who have heard me mentioning this before but arguing against upstreaming this patch: I only just tweaked that this warning doesn't go away with more recent toolchains, but simply when switching to GCC5 build profile, and hence LTO. Build failure still reproducible with gcc 6.3.1 and GCC49. ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c index da93eb5829..18491c7378 100644 --- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c +++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c @@ -343,6 +343,7 @@ ArmJunoSetNicMacAddress () return Status; } + PciRegBase = 0; Status = InitPciDev (PciIo, &PciRegBase, &OldPciAttr); if (EFI_ERROR (Status)) { return Status;