From patchwork Thu Sep 22 09:39:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9344873 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 56F8060B16 for ; Thu, 22 Sep 2016 09:41:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48CA02A924 for ; Thu, 22 Sep 2016 09:41:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39EFF2A922; Thu, 22 Sep 2016 09:41:25 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 C0FEC2A922 for ; Thu, 22 Sep 2016 09:41:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933380AbcIVJlQ (ORCPT ); Thu, 22 Sep 2016 05:41:16 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:57050 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933378AbcIVJlN (ORCPT ); Thu, 22 Sep 2016 05:41:13 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MDxZH-1bl4A62Kvn-00HLo7; Thu, 22 Sep 2016 11:40:21 +0200 From: Arnd Bergmann To: Bjorn Helgaas Cc: Arnd Bergmann , Shawn Lin , Wenrui Li , Heiko Stuebner , Brian Norris , linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI: rockchip: fix uninitialized variable use Date: Thu, 22 Sep 2016 11:39:59 +0200 Message-Id: <20160922094018.2138640-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:wK8OoC3zEdJ4oi4+DAGi9jfT5auO+s2S9a6CGIxjwOIb0wpl7ik /AS3Ss0xf9lhjztZzCfQho8W+BU/ZGW9iGpweV9Y6SzM7Cb1Cy/yQcltRi1u7IJABhW91P3 vwhscu9j+0f63tNDCyO08vB7P1tz6Cv8McI2cAdbEKrd2eu/ibu3fYIz18ch/yp0ug0bxFY 4ydEOHzryRedDpv/q/nfw== X-UI-Out-Filterresults: notjunk:1; V01:K0:+98+Z0zEYB0=:j0TqJXCAGfo+mw3mWwPf5N O0tgMp11xzrskYGAyyogEiEl5utVFqlXQmO0XkYtNtkDF9R+eiPrK8IEzyBl8ttQexXtBYHaR sR56a7/qQwD1YdAUtYLEw1mwYdHVTh+kcS8yiU440AEPUBDnO0gypkwbYeMFh7Lw5fY6Ecj+g Pwu1OhTCO7VQ0T7dfarljcuEBKU36vzlq9owSsobK5txBjUixgUDNNu2GBB8BBalb1FEWs3dd zvXnlqVrxnOO/n5hfhUnDtsiW6w4bsTBo+bBQKnbpcz7JgI5105UQ08n6PiSED9q1JzdP0p6Q ifJ0/vj2hNQxPOG+aUEnmqG8mM26/b0NdG0aHUqdTLYlL/5VKimd0RQWz0JeGDGQz1IBVpmNM kRN8/ACXzS6B767XQHdTF3JepZsiZNjXdMZFY4kkjE61ueYk80peXOTQNm3DBhcQUEF/iQeSL UVWALmNh3i05kvPPbVjRnlUVEd2P59oUZ6kD3XPTxsq86e3cj2nX+6eeJqzpdDLOO5rexWB9I eIn91V8/+3Up5wSaDjy4j/PU251wFHOx7K7LnWKut96xGgPKJz1hlwywnS2ZP51xpK8NRxyJM xgM9QmN4BHYzBfHSOuBqZfhfMOeXTEtOaGRQ3sBnm1YHblR+Jg5TdC05a37ZVQ7nnsCr86mlh plAC0b1ZEfVOei6DPIH2wm7RDubIwMAyrh+sKJmZq1V9nph+nImuriD9FDH6jCj9qF2M= 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 The newly added pcie-rockchip driver fails to initialize the io_size variable if the DT doesn't provide ranges for the PCI I/O space, as found by building it with -Wmaybe-uninitialized: drivers/pci/host/pcie-rockchip.c: In function 'rockchip_pcie_probe': drivers/pci/host/pcie-rockchip.c:1007:6: warning: 'io_size' may be used uninitialized in this function [-Wmaybe-uninitialized] This adds an appropriate initialization immediately in front of the loop, so the io_size is zero as expected afterwards for that case. Fixes: abe17181b16f ("PCI: rockchip: Add Rockchip PCIe controller support") Signed-off-by: Arnd Bergmann Reviewed-by: Brian Norris Acked-by: Shawn Lin --- drivers/pci/host/pcie-rockchip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c index c3593e633ccd..8bedc1e1ef80 100644 --- a/drivers/pci/host/pcie-rockchip.c +++ b/drivers/pci/host/pcie-rockchip.c @@ -1078,6 +1078,7 @@ static int rockchip_pcie_probe(struct platform_device *pdev) goto err_vpcie; /* Get the I/O and memory ranges from DT */ + io_size = 0; resource_list_for_each_entry(win, &res) { switch (resource_type(win->res)) { case IORESOURCE_IO: