Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp634503imu; Thu, 13 Dec 2018 01:36:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/UGWt9F2Bnp0W+y4EXXtRieJDPEqNifrv1pJKRyXLW5bNpNRmHOaT0rhcJJ1bpTWDovnOmn X-Received: by 2002:a62:e044:: with SMTP id f65mr23201986pfh.208.1544693788065; Thu, 13 Dec 2018 01:36:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1544693788; cv=pass; d=google.com; s=arc-20160816; b=WVnrMXdcYa3nZCMJdHROlHtphI3+qqDluhusWMblE5IaXO8bE8XnL+8RxSVCM5vlUH ZmPrAnsuZMOwPwhf6IcqTtFvJ5hqPAKc8BelIMCClenCwdXvzosWWXEiOElS9E9xCnct QE/AfdEJpgi/BqS9baQPpV5c1tKxyeI7OQxaYbxF/sfsKFxtM0D7AdWKpvZiznMuG8aq 5fkQ1zPWny2JoRchfC3P3J0nIqrf7a+GnmQJVPy3KQsognggQwHeavILpxZzK7qzVT8b dGsRgrdqUp+lWgFy+QPlUwlPp3/63BLQ0CuLqs8UdW7lueAwfIGo7JMYkZuM19+h7Cq1 waqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :date:subject:message-id:cc:to:from:dkim-signature :domainkey-signature; bh=WQFj6Edup29JXr8BKN7hxEZ2IYC07JDP5gVeunBL/H8=; b=brv3wLWxTjdzhwEjeiyA4uThi+dmgmd+KcRz5iD7S1OPbc1pfdSYb+LeVP21bUB6hn RHslnlBQkNDS0fdYR5YjsUb3ZLiS6Va2OHl+yPOJJuDTwxq788HsDvk6KsGPXCU62pJ5 GdsNbohiyq/EDMdL8eqjDN0+KS83CgfY/kRR5FVx+02Aevs44Ap5S44O5dohw9OfJDJP 6V7AsGS00v88+NjaeMmASktfDR6HS5XAKRET/emkyNXrIHTNDTTdA37Mozm7cQXFEfJE ie7Jf450x4NYq9jrdPdz3UTV/LlKPkz3NnUlaa7d833kxpjEL2I7Q5tG0O9yFco3jHR2 EEOQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zoho.com header.s=default header.b="J0idZ/yb"; arc=pass (i=1 spf=pass spfdomain=zoho.com dkim=pass dkdomain=zoho.com dmarc=pass fromdomain=zoho.com>); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zoho.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t75si1230389pfi.193.2018.12.13.01.36.13; Thu, 13 Dec 2018 01:36:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zoho.com header.s=default header.b="J0idZ/yb"; arc=pass (i=1 spf=pass spfdomain=zoho.com dkim=pass dkdomain=zoho.com dmarc=pass fromdomain=zoho.com>); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zoho.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727957AbeLMJfQ (ORCPT + 99 others); Thu, 13 Dec 2018 04:35:16 -0500 Received: from sender-pp-092.zoho.com ([135.84.80.237]:25412 "EHLO sender-pp-092.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727236AbeLMJfP (ORCPT ); Thu, 13 Dec 2018 04:35:15 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1544693706; cv=none; d=zoho.com; s=zohoarc; b=l0PYZHGMb4Ctl3V6m0/Ky0mVWRT3SJIe1j8xPjNoBMQPKxxa6jQCKyyA/FdWnPNx4eEyMZ9mPs5u+naOYA/HhFEqkkUh0tgkk0H9HJo5xjPesfS7mtEiC2xWrwr4yLCJAcldaaBM8mvgql51mXd9Y/cEvXunVcnRU1asbnZYHNA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1544693706; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To:ARC-Authentication-Results; bh=WQFj6Edup29JXr8BKN7hxEZ2IYC07JDP5gVeunBL/H8=; b=Es9cP1NxnovrX8BrV8bRbCKM9eY7YVFc+Zmm0l67190snYDnHlW9o1fcvEXzKL5oGNYWyAcd6u+r0hwRbx0e/bYnIQ8VtTsZ51rj4bETUvQWqf8ESkvZRceeWRtyC5dJBCxCxOEOTShDlq9VMv1USm/sj8MaOGl/DMNwfUf3cIs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=yehs2007@zoho.com; dmarc=pass header.from= header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:message-id:subject:date:mime-version:content-type; b=tRTxdSJxg+sxqLAEXPnMxmQphSo2xTKfmMJa38psvZB4mfSfU2XXGgu6Th5MIOutdeouMMWI40TH Z77PmiVKgEpT9yoA+UWWnLDhBGWHIGHJSGv8hn9LtBtT4915hA6O DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1544693706; s=default; d=zoho.com; i=yehs2007@zoho.com; h=From:To:Cc:Message-ID:Subject:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; l=3398; bh=WQFj6Edup29JXr8BKN7hxEZ2IYC07JDP5gVeunBL/H8=; b=J0idZ/ybcT4PIgwrIU1DJR3Ha3OtCIyuLyHgBXau/NPH2QA61Rbv2WiNPPxesWYs vB58OHqOGIJKlXLKqm0xIAgVb7IpVr1S1VNg8GsNL+Cp+J8Oh37vZvcKpcWReNH94iz 8kvb62O2iAOanCx/QXtMgDKP4JQTSDO+3XRdoIAw= Received: from YEHS1XR956R00D1.lenovo.com (125.33.111.245 [125.33.111.245]) by mx.zohomail.com with SMTPS id 1544693703614393.6282955707112; Thu, 13 Dec 2018 01:35:03 -0800 (PST) From: Huaisheng Ye To: alexander.deucher@amd.com, harry.wentland@amd.com, christian.koenig@amd.com, David1.Zhou@amd.com, tony.cheng@amd.com Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, chengnt@lenovo.com, Huaisheng Ye Message-ID: <20181213093454.10872-1-yehs2007@zoho.com> Subject: [PATCH] drm/amd/display: fix compiler warnings about wm variable Date: Thu, 13 Dec 2018 17:34:54 +0800 X-Mailer: git-send-email 2.17.0.windows.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huaisheng Ye There are compiler warnings within functions 'dcn10_log_hubbub_state=E2=80= =99 and 'dcn10_get_hubbub_state=E2=80=99. This patch avoids the compiler report= s the following warning when building amdgpu.ko. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c: In fun= ction =E2=80=98dcn10_log_hubbub_state=E2=80=99: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:94:9: w= arning: missing braces around initializer [-Wmissing-braces] struct dcn_hubbub_wm wm =3D {0}; ^ drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:94:9: w= arning: (near initialization for =E2=80=98wm.sets=E2=80=99) [-Wmissing-brac= es] drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer_debug.c: = In function =E2=80=98dcn10_get_hubbub_state=E2=80=99: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer_debug.c:7= 4:9: warning: missing braces around initializer [-Wmissing-braces] struct dcn_hubbub_wm wm =3D {0}; ^ drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer_debug.c:7= 4:9: warning: (near initialization for =E2=80=98wm.sets=E2=80=99) [-Wmissin= g-braces] Signed-off-by: Huaisheng Ye --- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 ++- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/dr= ivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c index 193184a..e96933a 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c @@ -91,9 +91,10 @@ static void log_mpc_crc(struct dc *dc, void dcn10_log_hubbub_state(struct dc *dc, struct dc_log_buffer_ctx *log_c= tx) { =09struct dc_context *dc_ctx =3D dc->ctx; -=09struct dcn_hubbub_wm wm =3D {0}; +=09struct dcn_hubbub_wm wm; =09int i; =20 +=09memset(&wm, 0, sizeof(struct dcn_hubbub_wm)); =09hubbub1_wm_read_state(dc->res_pool->hubbub, &wm); =20 =09DTN_INFO("HUBBUB WM: data_urgent pte_meta_urgent" diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.= c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c index 6415890..f5610ea 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c @@ -71,7 +71,7 @@ static unsigned int snprintf_count(char *pBuf, unsigned i= nt bufSize, char *fmt, static unsigned int dcn10_get_hubbub_state(struct dc *dc, char *pBuf, unsi= gned int bufSize) { =09struct dc_context *dc_ctx =3D dc->ctx; -=09struct dcn_hubbub_wm wm =3D {0}; +=09struct dcn_hubbub_wm wm; =09int i; =20 =09unsigned int chars_printed =3D 0; @@ -80,6 +80,7 @@ static unsigned int dcn10_get_hubbub_state(struct dc *dc,= char *pBuf, unsigned i =09const uint32_t ref_clk_mhz =3D dc_ctx->dc->res_pool->ref_clock_inKhz / = 1000; =09static const unsigned int frac =3D 1000; =20 +=09memset(&wm, 0, sizeof(struct dcn_hubbub_wm)); =09hubbub1_wm_read_state(dc->res_pool->hubbub, &wm); =20 =09chars_printed =3D snprintf_count(pBuf, remaining_buffer, "wm_set_index,= data_urgent,pte_meta_urgent,sr_enter,sr_exit,dram_clk_chanage\n"); --=20 1.8.3.1