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: 8861281 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8C5DD9F3A0 for ; Sat, 16 Apr 2016 07:04:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BB4FE201ED for ; Sat, 16 Apr 2016 07:04:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6B0520221 for ; Sat, 16 Apr 2016 07:04:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751092AbcDPHE2 (ORCPT ); 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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);