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: 120554 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4520018qgn; Mon, 4 Dec 2017 06:44:53 -0800 (PST) X-Google-Smtp-Source: AGs4zMZwe2Za9geXyu52O7Gwnb8+aK9UKqhyA3oAzDhs0CWUnW8pe1Zo0PxpBf+z9/SEydyuWrHy X-Received: by 10.98.67.150 with SMTP id l22mr19776827pfi.32.1512398693068; Mon, 04 Dec 2017 06:44:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512398693; cv=none; d=google.com; s=arc-20160816; b=PTLPfLShorSBeO9zu91g4R2s9FhUSeRkKgWfXb6yUYPTy2/YwPcrLTJeZBdqFPFIDk fTF+odPxlB6QrEKj4As5JOKzjP4hgDEgHZT+ov5cdFUKVVCCaT8D2gsuWzbWSnJU4H51 6m3UI+ZJb0ZVv3rj6POgIIS0J+Znkh2BKBVvV/5PLf33yDUURuYPE9Xg/2M302an8BGa NyOqIOSdN1WoQ/UpFATQ+DzjpPdsVnLAXxBp3ONXij1HjrS+2lWRCy0vTR+bSKRHe38D PpgC33KFosrltKGgSlEjvNb6sr3Q97nhu5B8MF0Auay9NYQJE8IkwZrD6CFlI7PiPexC klgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=K2Yh9UkhAYeaZoCwmu+46cwkqtGsDd/Pxp8KoVigkUg=; b=tuJw3y7+eDYN79kIRSPLHuVlIaR4kj2T90ps2vg1Ko5B5WlxPEh+VlmE7Qb5OrBRFv UGRFyEh9LNJmUiGijqdP9OWqs/ueqY6Sh8J42SAROAjgIDM9y0uGiz3FFQ5TKQzqGqQw ybAjBPCJd/Cdij7efGe77lSJKww9rQUmgi0jI65aql6yy2rGtBWu43GACkcH6jBBqcuY /rdk6Ek/0kDBa2GU12wQTtBmkd2U4jzpLt2jY53Td84WUaDpmfXPliONBoatGjyb1L08 fsTcPWkbqx5gJWLkXpsUz09ZPrFs8QeX2shwT63e5LZVwNJ36RZ0PvSO4AfYjU+eIYpy kwaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l127si9639426pgl.128.2017.12.04.06.44.52; Mon, 04 Dec 2017 06:44:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752242AbdLDOov (ORCPT + 10 others); 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 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 --- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) -- 2.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;