From patchwork Fri Feb 1 20:15:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10794679 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD2D21805 for ; Sun, 3 Feb 2019 15:23:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD5192B77E for ; Sun, 3 Feb 2019 15:23:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C16D52B784; Sun, 3 Feb 2019 15:23:19 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,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 C4FC52B77E for ; Sun, 3 Feb 2019 15:23:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 97ADE6E3F4; Sun, 3 Feb 2019 15:23:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id D85016E363; Fri, 1 Feb 2019 20:15:53 +0000 (UTC) Received: by mail-ed1-x541.google.com with SMTP id d39so6424798edb.12; Fri, 01 Feb 2019 12:15:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Gq4xaRA94CBhLfyNRSOb/rI9jopU5xrx1oCHWIVSd6M=; b=k7qOtZrbav+KIDhdqJAOD3DGj0bWoao4Ml1GJivDtlrrn20r5KGvIys0JGCAfQG7UV A8SvSEg5UWaJ7uSn4BaLvkwn/TnznINTaHELk1c1xjUQ4w1E/y2rRe1AYQRaYcLvzfW5 dMQIrDfJJl8nTVat6ouIxB3PBNGs9VaqqMB+PNG+87UTY+Cq2G6Uie5A5/mPFyzGZ+zn SWQI2qPq25z7U4mTi5LeYK/EB0ur+WDKvpFGI1mkA8LhkfqhVPufAoEFynBlVzwDh1Jv JkKfytNa9dokl7VYlcS1vZr2tT3mREwdlOz0+87cHFrSyhUok80NO9YTkTOPU4LgKoHf 03Nw== X-Gm-Message-State: AJcUuke1dKMpZT7et5bNUNA1c4r1RY03Z/TkgjmTH6ZEHURWli6IJOtF YobJEwAAxHZ3RYP5LdJ9PKA= X-Google-Smtp-Source: ALg8bN6gNAUlfOugjKc87eLbTl9v52cAmdziiKwA2hu0H7IKKg4NXxcw4zZtWFTPfdDM5RB2figO2w== X-Received: by 2002:a17:906:7c51:: with SMTP id g17mr35447385ejp.196.1549052152207; Fri, 01 Feb 2019 12:15:52 -0800 (PST) Received: from localhost.localdomain ([2a01:4f9:2a:1fae::2]) by smtp.gmail.com with ESMTPSA id x38sm2258414edx.24.2019.02.01.12.15.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 12:15:51 -0800 (PST) From: Nathan Chancellor To: Harry Wentland , Leo Li Subject: [PATCH] drm/amd/display: Use memset to initialize variable in wait_for_training_aux_rd_interval Date: Fri, 1 Feb 2019 13:15:41 -0700 Message-Id: <20190201201541.13680-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Patchwork-Bot: notify X-Mailman-Approved-At: Sun, 03 Feb 2019 15:23:06 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nick Desaulniers , John Barberiz , Wenjing Liu , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Alex Deucher , Nathan Chancellor , =?utf-8?q?Christian_K=C3=B6ni?= =?utf-8?q?g?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang warns: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:50:57: warning: suggest braces around initialization of subobject [-Wmissing-braces] union training_aux_rd_interval training_rd_interval = {0}; ^ {} 1 warning generated. Previous efforts to fix this type of warning by adding or removing braces have been met with some pushback in favor of using memset [1][2]. Do that here, mirroring commit 05794eff1aa6 ("drm/amdgpu/gmc: fix compiler errors [-Werror,-Wmissing-braces] (V2)") in this tree. [1]: https://lore.kernel.org/lkml/022e41c0-8465-dc7a-a45c-64187ecd9684@amd.com/ [2]: https://lore.kernel.org/lkml/20181128.215241.702406654469517539.davem@davemloft.net/ Fixes: 3cec41769d21 ("drm/amd/display: Fix use of uninitialized union") Signed-off-by: Nathan Chancellor --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c index 92f565ca1260..5ee36d6e0512 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c @@ -47,7 +47,9 @@ static void wait_for_training_aux_rd_interval( struct dc_link *link, uint32_t default_wait_in_micro_secs) { - union training_aux_rd_interval training_rd_interval = {0}; + union training_aux_rd_interval training_rd_interval; + + memset(&training_rd_interval, 0, sizeof(training_rd_interval)); /* overwrite the delay if rev > 1.1*/ if (link->dpcd_caps.dpcd_rev.raw >= DPCD_REV_12) {