From patchwork Fri Sep 15 20:15:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 112759 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1016343qgf; Fri, 15 Sep 2017 13:15:54 -0700 (PDT) X-Google-Smtp-Source: AOwi7QC/ZIETCSUD7cTQiGSuQd/MJP0M+1ijN/kSFRIRgDdFaHomg5pboy5Mkl2NUMgy90VqOFX3 X-Received: by 10.84.225.130 with SMTP id u2mr713609plj.334.1505506554870; Fri, 15 Sep 2017 13:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505506554; cv=none; d=google.com; s=arc-20160816; b=VvbeQ5AxNNQWYI5+gBu5QGLYtVmQkul7h2lcBf5OyP69Hwxxnl0daZLcs8NHpDBwyw LzA+f3uD+AUBQJWcZXk4NTN0d4joFmAQ3G0Q9asPHwnopAAjLY3gWnK86NY0PJfNMOcm DRckI+98jFkX2chnkvWVGEIh4yKfUo4813bYsAkJJEUESARGj+G9+HfJR7qUxxbuGQ4m ZrHn0ZqdW1+I48UmWfjtUsMYr0hiRoNi0Lo82pQ9750kPI4x6Wsjl/b6syBs1cy8GG3l dvV5ATU/xn8QgDwK+bTjvIszM3HmAqFnXfwuaA4CzIenqUuTE0LJwoqjr/bgKv2ZPs1w 1Opg== 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=uBR9feKHdSpWNkcNJWSPW43NBjPWTgnRCnVdBX2DpLI=; b=Mpg6KH5cVUJia2cTb8sjGj9ktTgZ7XA8LiYsmh/x8y3Q159wjEI6GnHDVB29hxnFtM lNmV2R49m7FVXhZAG7OFYx9ViYmrSdpF34h5HDhYFhfx2IiSWf2cSf8/jwMIyob8Eu67 m696uGjbDrqw+zAIt3+EBTBh2SsG1cyjqEl24KIC9sA5ju9wHPxo8J/Lqa3m7den/v9N sZhwB97RXqS4BlDQVkWcKZk5qcP61oRh3bms+53k3J6oCx8kSWnCkDT3f7Gvykoe2Mzb ek4iaZbVrM7bgimYtagcCTgqLWVEsO8aDn+LnxMeo1dFfsAgu6ihBAzk7O1fGaxg44KA KR2A== 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 c76si1087874pga.574.2017.09.15.13.15.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Sep 2017 13:15:54 -0700 (PDT) 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 369CD6E1A4; Fri, 15 Sep 2017 20:15:53 +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 [217.72.192.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 73DEF6E1A4 for ; Fri, 15 Sep 2017 20:15:51 +0000 (UTC) Received: from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0LmNdq-1dKRUF0ZOc-00a10T; Fri, 15 Sep 2017 22:15:41 +0200 From: Arnd Bergmann To: Patrik Jakobsson , David Airlie Subject: [PATCH] drm/gma500: initialize gma_clock_t structures Date: Fri, 15 Sep 2017 22:15:27 +0200 Message-Id: <20170915201537.2050843-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:uvBtHerMLZLhqgLKDekAUTC95InQ+C8wynzNYqImQbPfc9FefLp aARgfT244TDlsAo1Dx1ozEqyt5VWwludj2QAJ097tGE3e837tXz7bHmJt+9oenJRUmO9z0s /TDqwbrxX9oaR+H9UKOCTYCGisyEKe7bvY9hFmflNjGk7agYuSJDLctkxRX32fLyQvjKKqd U24MAg9z1ZYNyt9Eg4IrQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Tru9Mq1PwqQ=:4xin1hwpnhbStcbS1tpbHh WDAvQNB5PT3R66L7x5rsYaQe0PatQvCCWyvM3H3NSVZpfWy5DSTfTPi2PL1Rw7aLvirISSwtn M6XE1mTpG8epILENxO6YaBifUeeiQpSUjvmFrvxEtzOkKGOmRSm5DDm2T89RRrk6TygJddNWg 5NNkS0RPgfZQHpDXUFR98bAWCMlL79tI9MqLZCDF7vdg0e7slZNAvjCaUdxGIOgauqoAY2NeM xXUCfTjhrKvMHComL4oM66yjdE06zHdxIiG7tj3/o/gWxhUEBC/UE8CSRehQiAn8IE/03PTeo doB28imnnbS7m4DKi7f8zqSPfZcMXkqLWoeAR9QKJZYwbzB+/jNu3WFIEkAojWgi5KWA5fvYt ehnDTIsBBKhIxRPMUKuveD8M1f6/YlrF/uQxDDwQR+OaW3MHOWrDHJUaur8W45LlYNGNtTO2z JmGxpO0TggU+ScIhurvDPuyBOeqKIGZS8NtipplFhZRllwisDSR+w8xqjuPRkjNhkNJIl/tDb JWPrNSgwR8+u9madJrcXFOFc1UhdT7BVxLOk0HTPJMieW5kR/u1gQwNhOuefRS++eKOyy/SPM HBXwBnZsEkLN/1qYA18nB1nJf97IvK/yB7v3YoSmhoQJ+3dX/XfhLDjjezZ36M20Xza0O1oF+ lSwa7UVkbkKYTd9qb1AoELIFIBmicFgANs1s5aZexnAqnBHXRiY0ati6zWw21k863B+xYJNWo rak/cCbHHSjEAAk/hHKmuEAs47ejzYh4uvP1VA== Cc: Arnd Bergmann , Daniel Vetter , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Laurent Pinchart , Alex Deucher 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 --- 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));