From patchwork Tue Jan 16 14:57:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 124724 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1040867lje; Tue, 16 Jan 2018 06:57:28 -0800 (PST) X-Google-Smtp-Source: ACJfBouFopli1JXipXp3Cp9PldnFTqfOYYdSBRKuM5BppfoGM2WTFSDwdgRADjCrGg6yxwcaNyRA X-Received: by 10.98.131.200 with SMTP id h191mr20342048pfe.149.1516114647966; Tue, 16 Jan 2018 06:57:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516114647; cv=none; d=google.com; s=arc-20160816; b=dntrZ91/Ov1CiVB636yp17QH7lHNhoOpkU3QC5voR8WCIjrffuOvA1X3qSrT7QbLUa Jwk9M/r2bzcyIScimg8KO60Y20Mn8sDdQ7Ar4pwn0ilMlfAFtLjQTqhLyDP/ld3cdYKO wfj8dL+UvRePjc7CP62A64SuXOxJ1inoazSnoGqqdz5JfjsGa6yuwsjQsWrD3sqqc0XE DhXWhCDt5rxeLKctUo4FERLndtyFXwdi1oisncMfOxWpmsHzkeNxxqJLU+OYFxnUmg30 B/srLYf4JWsFvS2mHAvl6YlRxHFc80EDf1r1RYpLYz+Jxr061O2WHUbKONC9IBgZdH95 U97Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=EGDNnXoznYMKJW28YjxMrFpyI5VkhYoiaH/atC1bIH0=; b=dVAOO+23mqm4UXGgTlGsQbixCIj9lVq/d69BT4simVNb7P4DXM6exbddoaF9b7Vf0P 6gosLD2ObY4OXinL3OlGZ6n73d8BiiMJ+ObGkqAara1hNG0Yf+d3SFUrd+znBT2EYggS qCoqxtCU612fuFVpF+VH2a8QPLu7MC/Ova+3oZ49o2ddE7ZNSlGOq1xydHarDwnb6NgD HQRoAx+RmZEw0DKHN6l0yVVJURydblm5OZiTn5HI0C1h7KUIXDkeuo5+oVWHocHjwcQg wtFlDJwMM3tYJU1P7MpEAbvCqiZhxdfSFGxFYDe0NN3QPa387Lv7Hz+9qmTz1SlIcuS+ PW6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id bd7si1977725plb.637.2018.01.16.06.57.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jan 2018 06:57:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B63389C08; Tue, 16 Jan 2018 14:57:25 +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.135]) by gabe.freedesktop.org (Postfix) with ESMTPS id BFE8C89C08 for ; Tue, 16 Jan 2018 14:57:23 +0000 (UTC) Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0M0H6r-1eqFsC09uP-00ube0; Tue, 16 Jan 2018 15:57:21 +0100 From: Arnd Bergmann To: Patrik Jakobsson , David Airlie Subject: [PATCH] [RESEND] drm/gma500: initialize gma_clock_t structures Date: Tue, 16 Jan 2018 15:57:10 +0100 Message-Id: <20180116145720.2348043-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:P/KFwj9Gg650HWYC6sH5JDddZxLPAU9wzvF9otjaO0jWKmPmb0Y 0Om7MmJINY1UGm/QUqcAtPhMpfm1dvS4XYiIpDfr4C32oDX04FQ1r/M69G8DT3y6MWSV1I2 xxL88So0hnvEcxzTHhSvxTHCt0a6vif981ZUWyCf2dhg3ovBpcDSYqow6LpL1ZqFJTYGtSM hGC4D2Bh01LVBhKACY6Ng== X-UI-Out-Filterresults: notjunk:1; V01:K0:juOakUkU7Es=:37Mh6ANXWfxB4uV0S4nPBI GUnzqjMmArk+smCwkFLfgmfqidCqIbqlCo1E0EK2HPmoVcQLsp9RULo0IcdTbOjh85Ao0CkjV oc5uXBfAVEBueZGBtACkVJ4J1upn71yC+W2j5SnBl4VRmqfBwSmwFhP0sw7BDbhZ4KGjY+8WT PctlgTSrpoxPKKiMefjqiz7roIup4Lee2MVqoby4SN4j1DTYTdYNhQ64beeCQ9sp552SoE/my WnQ0Eyi0ZVNIoUI+c/kHvvmN9lkjinHyVkTlAf84B4sWHxRJbsEEfE/pHvMeki2GgTRJfjaQJ eDE+peg740R/hVTPvugb6MDjanlzdtI2wGexLXzX6ckffOpExa/3P9+9eAd18FyNDMY6tKqub Ba3v2sbKQRp3C21+T5/BWndDWzzK/fI+Chk0bcAbE28Nipn24o919ITUupUa2esuiPm8sL8TX wIWHrjWSDio8S8mk0azintJgGexzUr5HTT9YY7pR+nTQ6DeOONcwN2xKo39FbmhO0qM17aeLt yzAb6a4BJTJk11jl7+LEtFpJ6RwUIt2XFO4Ch/QlgeYYnFvINUf6SRcpccMdFHVrJf1g8T4HF hwyOvFPtC5/a8d0hd4b5FQpRBEMAh1yYYIsCmhcD7ScCFu1wTjZalORGGpHlaXCeZxfCs0TxN vNoMSzKZtEEbB4IUkk9D4Yp2Qy///d03MkQTkA4vDMXBKt2cIMsFKjp/Jmb1XsJ9iDi1z/OP1 WSDElG5ltTw1c/I5C/UaNhz9YjKmPUJNhZGtjg== Cc: dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-kernel@vger.kernel.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" The two functions pass a partially initialized structure back to the caller after a memset() on the destination. This is not entirely well-defined, most compilers are sensible enough to either keep the zero-initialization for the uninitialized members, but gcc-4.4 does not, and it warns about this: drivers/gpu/drm/gma500/oaktrail_crtc.c: In function 'mrst_sdvo_find_best_pll': drivers/gpu/drm/gma500/oaktrail_crtc.c:175: warning: 'clock.vco' may be used uninitialized in this function drivers/gpu/drm/gma500/oaktrail_crtc.c:175: warning: 'clock.dot' may be used uninitialized in this function drivers/gpu/drm/gma500/oaktrail_crtc.c:175: warning: 'clock.p2' may be used uninitialized in this function drivers/gpu/drm/gma500/oaktrail_crtc.c:175: warning: 'clock.m2' may be used uninitialized in this function drivers/gpu/drm/gma500/oaktrail_crtc.c:175: warning: 'clock.m1' may be used uninitialized in this function drivers/gpu/drm/gma500/oaktrail_crtc.c: In function 'mrst_lvds_find_best_pll': drivers/gpu/drm/gma500/oaktrail_crtc.c:208: warning: 'clock.p' may be used uninitialized in this function drivers/gpu/drm/gma500/oaktrail_crtc.c:208: warning: 'clock.vco' may be used uninitialized in this function drivers/gpu/drm/gma500/oaktrail_crtc.c:208: warning: 'clock.p2' may be used uninitialized in this function drivers/gpu/drm/gma500/oaktrail_crtc.c:208: warning: 'clock.m2' may be used uninitialized in this function drivers/gpu/drm/gma500/oaktrail_crtc.c:208: warning: 'clock.m1' may be used uninitialized in this function drivers/gpu/drm/gma500/oaktrail_crtc.c:208: warning: 'clock.n' may be used uninitialized in this function This adds an initialization at declaration time to avoid the warning and make it well-defined on all compiler versions. Signed-off-by: Arnd Bergmann --- Originally submitted on Sep 15, 2017, but got no reply. Resending unchanged. --- drivers/gpu/drm/gma500/oaktrail_crtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/gma500/oaktrail_crtc.c b/drivers/gpu/drm/gma500/oaktrail_crtc.c index 0fff269d3fe6..b49fe79c3f44 100644 --- a/drivers/gpu/drm/gma500/oaktrail_crtc.c +++ b/drivers/gpu/drm/gma500/oaktrail_crtc.c @@ -134,7 +134,7 @@ static bool mrst_sdvo_find_best_pll(const struct gma_limit_t *limit, struct drm_crtc *crtc, int target, int refclk, struct gma_clock_t *best_clock) { - struct gma_clock_t clock; + struct gma_clock_t clock = {}; u32 target_vco, actual_freq; s32 freq_error, min_error = 100000; @@ -191,7 +191,7 @@ static bool mrst_lvds_find_best_pll(const struct gma_limit_t *limit, struct drm_crtc *crtc, int target, int refclk, struct gma_clock_t *best_clock) { - struct gma_clock_t clock; + struct gma_clock_t clock = {}; int err = target; memset(best_clock, 0, sizeof(*best_clock));