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: 101761 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp2498243qgf; Thu, 22 Sep 2016 02:41:28 -0700 (PDT) X-Received: by 10.98.220.93 with SMTP id t90mr1751303pfg.30.1474537288886; Thu, 22 Sep 2016 02:41:28 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id if10si1341160pad.130.2016.09.22.02.41.28; Thu, 22 Sep 2016 02:41:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933453AbcIVJlS (ORCPT + 27 others); Thu, 22 Sep 2016 05:41:18 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/pci/host/pcie-rockchip.c | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 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: