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: 10090555 X-Patchwork-Delegate: agross@codeaurora.org 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 E31286056E 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 EA60428497 for ; Mon, 4 Dec 2017 14:44:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF13728D96; 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=-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 938D428497 for ; Mon, 4 Dec 2017 14:44:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752242AbdLDOov (ORCPT ); Mon, 4 Dec 2017 09:44:51 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:50835 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751205AbdLDOou (ORCPT ); Mon, 4 Dec 2017 09:44:50 -0500 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 Cc: Arnd Bergmann , Archit Taneja , Daniel Vetter , Liviu Dudau , Laurent Pinchart , Gustavo Padovan , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org 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== Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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;