From patchwork Fri Feb 1 20:12:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10794709 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 AE3991390 for ; Sun, 3 Feb 2019 15:23:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EB582B77E for ; Sun, 3 Feb 2019 15:23:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 931662B784; Sun, 3 Feb 2019 15:23:43 +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 553722B77E for ; Sun, 3 Feb 2019 15:23:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD0ED6E41B; Sun, 3 Feb 2019 15:23:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A1CA6E363; Fri, 1 Feb 2019 20:13:02 +0000 (UTC) Received: by mail-ed1-x544.google.com with SMTP id b14so6455699edt.6; Fri, 01 Feb 2019 12:13:02 -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=4pay4XeW+oogi+CzejAnHBYw0nfnymIcC7dpDfzr1mY=; b=aWwhuunHdPGK30AwCiPB7cDtgl0k//CoW55aKJgQdq6QHs2Qcdq+hllT+YQQ4E+/A6 YVHtAujBFNnPtbxJlcrom4FzL7M+uSKWZaHwFkRDY7xqFMF7NGNW1j5E/uTObAisRnPh Mr5YAvxShAGekg/0eBdHunBmfXrQgy3NG9riEBB4PVf+psZYDceCl5W/SQ5MeRQN8Ulx DE3tzGwE9Aj/2ceM4Cd6rWZcPrr8A6EF9TQI7Jbu1LnBS5an0hY++27or4CE3IUv8Tgm xPnREdlhgryzsox5k/fDCJw0FtX4ugoXdD8gBU/Jl8XB8A9+WfQ1RZ+1BRrKfF/iFhwW 9e0Q== X-Gm-Message-State: AJcUukcQL7+xX6A8RyhmIOC2CncDT4Cr776x14rtW3oywIKGkxR2pgUu uB7Z2n/tZDlyQ7mQIkE9+jSnF2xNDOpBgA== X-Google-Smtp-Source: ALg8bN7g/HjniQfJNUElU5nZx7wv4IiJaw1zs4z7jn1qdcQWDPPVBGYMgQWrlQItb/Kjw8XDF8zuGA== X-Received: by 2002:a50:d311:: with SMTP id g17mr39349781edh.187.1549051980479; Fri, 01 Feb 2019 12:13:00 -0800 (PST) Received: from localhost.localdomain ([2a01:4f9:2a:1fae::2]) by smtp.gmail.com with ESMTPSA id q4sm2256995eda.50.2019.02.01.12.12.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 12:12:59 -0800 (PST) From: Nathan Chancellor To: Harry Wentland , Leo Li Subject: [PATCH] drm/amd/display: Use memset to initialize variables in fill_plane_dcc_attributes Date: Fri, 1 Feb 2019 13:12:26 -0700 Message-Id: <20190201201226.12812-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 , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Nicholas Kazlauskas , 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/amdgpu_dm/amdgpu_dm.c:2314:38: warning: suggest braces around initialization of subobject [-Wmissing-braces] struct dc_surface_dcc_cap output = {0}; ^ {} 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: 7df7e505e82a ("drm/amd/display: Set requested plane state DCC params for GFX9") Signed-off-by: Nathan Chancellor --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index dccad2d207ce..1c1c162c4eee 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2310,12 +2310,15 @@ static bool fill_plane_dcc_attributes(struct amdgpu_device *adev, uint64_t info) { struct dc *dc = adev->dm.dc; - struct dc_dcc_surface_param input = {0}; - struct dc_surface_dcc_cap output = {0}; + struct dc_dcc_surface_param input; + struct dc_surface_dcc_cap output; uint32_t offset = AMDGPU_TILING_GET(info, DCC_OFFSET_256B); uint32_t i64b = AMDGPU_TILING_GET(info, DCC_INDEPENDENT_64B) != 0; uint64_t dcc_address; + memset(&input, 0, sizeof(input)); + memset(&output, 0, sizeof(output)); + if (!offset) return false;