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: 9441267 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 48043600BA for ; Tue, 22 Nov 2016 14:23:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BBF328568 for ; Tue, 22 Nov 2016 14:23:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 307D62856B; Tue, 22 Nov 2016 14:23:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEB2328568 for ; Tue, 22 Nov 2016 14:23:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933316AbcKVOXV (ORCPT ); Tue, 22 Nov 2016 09:23:21 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:54505 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755660AbcKVOUA (ORCPT ); Tue, 22 Nov 2016 09:20:00 -0500 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 Cc: Arnd Bergmann , Ray Jui , Scott Branden , Jon Mason , bcm-kernel-feedback-list@broadcom.com, Oza Oza , "Dmitry V. Krivenok" , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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",