From patchwork Mon Dec 4 14:44:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10090553 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 475AD6056E for ; Mon, 4 Dec 2017 14:44:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D99F28497 for ; Mon, 4 Dec 2017 14:44:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41B2028D96; Mon, 4 Dec 2017 14:44:52 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2761D28497 for ; Mon, 4 Dec 2017 14:44:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3AD76E362; Mon, 4 Dec 2017 14:44:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) by gabe.freedesktop.org (Postfix) with ESMTPS id 529026E362 for ; Mon, 4 Dec 2017 14:44:48 +0000 (UTC) Received: from wuerfel.lan ([149.172.96.106]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0MXCef-1eXdXn3uNR-00WAzq; Mon, 04 Dec 2017 15:44:39 +0100 From: Arnd Bergmann To: Rob Clark , David Airlie Subject: [PATCH] drm: msm: avoid false-positive -Wmaybe-uninitialized warning Date: Mon, 4 Dec 2017 15:44:23 +0100 Message-Id: <20171204144436.272626-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:mfGlvXwqBVdBIphe+i5hJCqNQLwGR2rEpBlonQ7L2yib2DRncrA Xvw/4I3VSGobAnXrdtV0bAONcSZTA9rG/BbBIrFB3wteFf3qTD/r9IiEOzTQNn4D5nw6mut ZcxQHQKaIn+x/OkcxQrN3t6Cf9E1Y0mB3+h8ydyCBvQ2Cl2C5csGz1SjOgJtSmxcx+I7xfu Cazs9cTjAwqZWha280cUA== X-UI-Out-Filterresults: notjunk:1; V01:K0:x0MZ63Gn1wI=:1XvXWXeiR18q03kgYXVJm1 tykU1pMfog5SdY6JmscOBzHI6VCoKb/7z+o+TCNE1O9DN83/GHAFPiVR3dTr27WY2/P98VSi/ 1jnwGLztVyzMRiicSSWfYcC5e9K1QOsBsbmN0rG7YmbylJFANwcwgm9O87xRlFeXFnbAyZxt+ FyuD2rNnmaXzoeMpNkSzbz1HRaBsJjCO2FDtsmgi3/wgbAJBOFShF3U6xhv02Rw2Rxp1a1VJU e/rJXcVi6DseEndxaQuHXM/lsDXuUWzEAc6uOyBY0ZsaFv3HzbgM+dSv/Iu1OvkZtqACh911A Lmz6FZZG94En/59B1QygnBqJiaEw3lm53/DIL1W9jxhoVgV4mjKaKaVcfzm0OATHWCLeYZptI keK4ACzSOBvfPjRr4sc6xgdTg6JMF6U29xT++IkA20+9hfrOvmyKvIRkmQ7ge+c32Kzjr7JWI LlOAm8R7d/ZSdujiaaAYiD3Tw5XVcokqBOCVLtyhO0X4dClKyVeo56K/yoL66pYY7/k6qT7eX 4dCJu0guqgAiKJwr0q4AaQmW2beRhcQhHGZM1MdC17VjxkYI0B5tAJo3TQvMPRlZMXVLW5t1u 9PEJoxzgkSkNrlvXBQ0iyKFoaP9h6pILzTOMoXXX11Wr3JOW0U8rvgxnVQjnOXWEKB9/JQwqW Nv8BpXSfznQ8yRqT9btjcXAYGhitOkdMt/GSoafhCPQaVhWxgHLW5MBKsVeaGG0ndmGCoQCY3 upgbQnAaqyuDSieKlhTdu9FcvrJqooYAKspDug== Cc: Arnd Bergmann , Daniel Vetter , Liviu Dudau , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Gustavo Padovan , Laurent Pinchart , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP gcc-8 -fsanitize-coverage=trace-pc produces a false-positive warning: drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c: In function 'mdp5_plane_mode_set.isra.8': drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:1053:3: error: 'crtc_x_r' may be used uninitialized in this function [-Werror=maybe-uninitialized] It's relatively clear from reading the source that this cannot happen, and older compilers get it right. This rearranges the code remove the two affected variables, which reliably avoids the problem. Signed-off-by: Arnd Bergmann Acked-by: Laurent Pinchart --- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c index be50445f9901..c50449882037 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c @@ -964,8 +964,6 @@ static int mdp5_plane_mode_set(struct drm_plane *plane, uint32_t src_x, src_y; uint32_t src_w, src_h; uint32_t src_img_w, src_img_h; - uint32_t src_x_r; - int crtc_x_r; int ret; nplanes = fb->format->num_planes; @@ -1010,9 +1008,6 @@ static int mdp5_plane_mode_set(struct drm_plane *plane, crtc_w /= 2; src_w /= 2; src_img_w /= 2; - - crtc_x_r = crtc_x + crtc_w; - src_x_r = src_x + src_w; } ret = calc_scalex_steps(plane, pix_format, src_w, crtc_w, step.x); @@ -1052,9 +1047,9 @@ static int mdp5_plane_mode_set(struct drm_plane *plane, if (right_hwpipe) mdp5_hwpipe_mode_set(mdp5_kms, right_hwpipe, fb, &step, &pe, config, hdecm, vdecm, hflip, vflip, - crtc_x_r, crtc_y, crtc_w, crtc_h, + crtc_x + crtc_w, crtc_y, crtc_w, crtc_h, src_img_w, src_img_h, - src_x_r, src_y, src_w, src_h); + src_x + src_w, src_y, src_w, src_h); plane->fb = fb;