From patchwork Tue Nov 22 14:17:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101477 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp2120197qge; Tue, 22 Nov 2016 06:20:44 -0800 (PST) X-Received: by 10.84.139.129 with SMTP id 1mr117430plr.178.1479824444456; Tue, 22 Nov 2016 06:20:44 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id b128si26617543pgc.336.2016.11.22.06.20.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Nov 2016 06:20:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9Bv7-0000Rv-St; Tue, 22 Nov 2016 14:19:37 +0000 Received: from mout.kundenserver.de ([217.72.192.75]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9Buy-0000GQ-Uv for linux-arm-kernel@lists.infradead.org; Tue, 22 Nov 2016 14:19:30 +0000 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MPp3a-1c5K1V3MSA-004xJL; Tue, 22 Nov 2016 15:19:04 +0100 From: Arnd Bergmann To: Bjorn Helgaas Subject: [PATCH 2/2] PCI: iproc: avoid maybe-uninitialized warning Date: Tue, 22 Nov 2016 15:17:52 +0100 Message-Id: <20161122141844.1655574-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161122141844.1655574-1-arnd@arndb.de> References: <20161122141844.1655574-1-arnd@arndb.de> X-Provags-ID: V03:K0:Gog2JX0woEIbtkmDjiVoj7HO2VoNthxCzEH0WCUdop22vkiwU3x Hxgsr/QadWyXurjfWMLFIm2fUQhOyymlu7iZnRzSjsK5fkAjH09M00dTiDWLQpdYmuFCldL QLlpvnrwo1EaMj1lA73INoerJK0Fg1fYjjF2lMCgi5BblK3W8OIGXqQy03b/vU6dcoSHPFf iuiFSaOr/mUIYzR2jA6wA== X-UI-Out-Filterresults: notjunk:1; V01:K0:I1jV4j4G3y0=:UR53tLHHeMIeikmu/rS9B7 2tfXMn4Xkm6Bjnt9y1vDPkZY9oLjxC+BGNf9ATNDAe4PFCoyKiz2HFhgj56reEo+yxx5vjmx+ htluRU7jqQtInFy7IyxwIpZBDLGK2eDAISsrgy6DnVd79MuyOHGjTYBjUjS5/HYvVrpSsKxO0 OL+tVn/Ex7UyPDBAEAi4TOPyTN+dTAgTaPyC7/qV+8ScOvsGIYuDo0Cln11hsrznTLR5dQmTK khAN7iq1pkBKU6amooRv7BYBFPq9v47a2XmFMHBQKkxhb0Oo/rIq2R+XKEc9vfsWUVobRHa3f lCusO18XKsIh/OpKYUEmKPQAkdRRPOMzjY1LzJOGqQaxK3Um00UqHgD8u5vsW4xDmACn9fBQu ERJf1hZFh0lqUoGyvyfELqc4EgFhvQB7AU5b4kTQu7SYN8RLXnaGcTZU1pdPyLYUJlsyU8Mpk CZCfOU0HthArQ3ubvoXvjgvm1UUcDcpzRnbuEyWkY0B/5KG2A1ycxQaxahzppXOP+tyPGiTht R+cGLXAXWXMIdXtmVuDCfGGO3dlIPY8p0FIMmZHeieZkkaUQ0jZSgOxd2GCTtJ1zY3B9BVBoJ GgcC5rDRdh9B7WS+ho34j42CygEmtVDg4lAZ+0RzbseVyLYG4hNnKcowGVsmWiCDjVXJWAAov BXSPVVvT9/toLfWEBlJwbfM0Y8k+ru1FY9AQbZH/9vjJy67atDazpbo0M4Mf1ez/EHdg= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161122_061929_503938_CC6549A0 X-CRM114-Status: GOOD ( 10.56 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [217.72.192.75 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.72.192.75 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Scott Branden , Jon Mason , Ray Jui , linux-kernel@vger.kernel.org, Oza Oza , "Dmitry V. Krivenok" , linux-pci@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org gcc notices that calling iproc_pcie_setup_ib with ib->nr_regions==0 would result in an uninitialized return value: drivers/pci/host/pcie-iproc.c: In function 'iproc_pcie_setup_ib': drivers/pci/host/pcie-iproc.c:894:6: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] This can't really happen, but the correct behavior of the function is probably to return -EINVAL if it ever did. Fixes: 4213e15c364e ("PCI: iproc: Make outbound mapping code more generic") Signed-off-by: Arnd Bergmann --- drivers/pci/host/pcie-iproc.c | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index 857ff5198317..0359569c8d78 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -936,6 +936,7 @@ static int iproc_pcie_setup_ib(struct iproc_pcie *pcie, } } + ret = -EINVAL; err_ib: dev_err(dev, "unable to configure inbound mapping\n"); dev_err(dev, "axi %pap, pci %pap, res size %pap\n",