From patchwork Sat Apr 16 07:03:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102515 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp313525qge; Sat, 16 Apr 2016 00:04:32 -0700 (PDT) X-Received: by 10.98.42.4 with SMTP id q4mr34531311pfq.23.1460790272501; Sat, 16 Apr 2016 00:04:32 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si7198042pfb.112.2016.04.16.00.04.32; Sat, 16 Apr 2016 00:04:32 -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 S1751205AbcDPHE2 (ORCPT + 29 others); Sat, 16 Apr 2016 03:04:28 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:50970 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbcDPHE1 (ORCPT ); Sat, 16 Apr 2016 03:04:27 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0LlpPU-1bQNyh09UO-00ZM19; Sat, 16 Apr 2016 09:04:15 +0200 From: Arnd Bergmann To: Mauro Carvalho Chehab , Greg Kroah-Hartman , Hans Verkuil , Amitoj Kaur Chawla , Prabhakar Lad , Arnd Bergmann Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: media/omap1: assign resource before use Date: Sat, 16 Apr 2016 09:03:47 +0200 Message-Id: <1460790246-3800892-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:Qp/vy9bD+fuQmH16yWUvpeZWp3573XHK2VLFF/KLiCk77178klC vcTOYpKC2J4wmHJCclCfYgdkFqgzdupw2MEYiR71oqlr1P+L/jIUKs0NLuhu9c6m9P7/e+9 NFbctC7tc7EYq5it6hMD/Xhmqo0zeDvjgzNHwt++RsICrBmkUyOBH+pkf5HVsQ5/3gA+z6i 7qntnlBo1i8KUmt50Iarg== X-UI-Out-Filterresults: notjunk:1; V01:K0:2HCAYZecLAg=:706Gnj8y2mEvL1a9p5fByy PF44WeSt0k9OjbBqbgo/yHV0nVE7XVoil2RsZHNpoiq0r988/HqUPFVAVUxYz4YoA4ttAPScX MpeUCKxuZrP3cZj5n0KmjegWO7M4EoaPQghuBgt3M9z/FdDM3iPm3bbLAG05GLiHD6bP1Wzoy S/rrssU3qmzc4qP7kNikrU0GX38AAYLcilz2ifOSerYpXti/DLU1en3LWDeJlUMXbSk3arBU5 7hm2XU7Q8LlZdBOjr1MZnqzsZt3Ienyo/rUee59KG+2zqulGOojqmoz25Uhq0+692HuUCtuX4 4ry2R0PAz+AOCpLSpdBa6fz4rWkhlif0c2bzThlbEwdeoxfJglIE3hycb3GrrJvs9RhX5ibkU 2ADDDpR35KbUxZEC+MHXG6yiu1/oq/aO08cHQ22uG95YsdlALaKd2m4DuZV7umlrC2ucK7ZbT AbHzG6t6VOpLk2HOOnO/aMz85NV1A1BJwkGNShRHH1/N1zsf7ikYWQXoHstqkMsSXifAtVygw yGB/U5l4+7YtNghPkuGHTrNNITel3iojvRBFjV4tdWMYYFU60jwqA5C3STAcIetIlTUBh3YQq o1TVH3FUNBCnwG3XOJEk0nkUL0IAwGK3+0mhxSG+CASQVYHG0euJUpP3XR/wjig+zol4EBAhI 64J817ZUbxuTblSoVCbPYwgBMsp3GBvYOKWH4sJB1PFJ0lheOwnQZyRfovsJ2UyMeEHI= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A recent cleanup patch accidentally moved the initial assignment of the register resource after its first use, as shown by this gcc warning: drivers/staging/media/omap1/omap1_camera.c: In function 'omap1_cam_probe': include/linux/ioport.h:191:12: error: 'res' may be used uninitialized in this function [-Werror=maybe-uninitialized] return res->end - res->start + 1; ~~~^~~~~ drivers/staging/media/omap1/omap1_camera.c:1566:19: note: 'res' was declared here struct resource *res; ^~~ This moves the line to immediately before the location that the variable is used in. Signed-off-by: Arnd Bergmann Fixes: 76e543382bd4 ("staging: media: omap1: Switch to devm_ioremap_resource") --- drivers/staging/media/omap1/omap1_camera.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/drivers/staging/media/omap1/omap1_camera.c b/drivers/staging/media/omap1/omap1_camera.c index 54b8dd2d2bba..078049481e8b 100644 --- a/drivers/staging/media/omap1/omap1_camera.c +++ b/drivers/staging/media/omap1/omap1_camera.c @@ -1579,6 +1579,7 @@ static int omap1_cam_probe(struct platform_device *pdev) if (IS_ERR(clk)) return PTR_ERR(clk); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); pcdev = devm_kzalloc(&pdev->dev, sizeof(*pcdev) + resource_size(res), GFP_KERNEL); if (!pcdev) @@ -1614,7 +1615,6 @@ static int omap1_cam_probe(struct platform_device *pdev) INIT_LIST_HEAD(&pcdev->capture); spin_lock_init(&pcdev->lock); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(base)) return PTR_ERR(base);