From patchwork Thu Dec 13 09:34:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10732821 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 F1A5D14DE for ; Mon, 17 Dec 2018 07:50:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6BEF297B0 for ; Mon, 17 Dec 2018 07:50:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAECA29934; Mon, 17 Dec 2018 07:50:45 +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,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 B485629927 for ; Mon, 17 Dec 2018 07:50:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4ABB16E293; Mon, 17 Dec 2018 07:50:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 906 seconds by postgrey-1.36 at gabe; Thu, 13 Dec 2018 09:50:19 UTC Received: from sender-pp-092.zoho.com (sender-pp-092.zoho.com [135.84.80.237]) by gabe.freedesktop.org (Postfix) with ESMTPS id 30CE36ED07 for ; Thu, 13 Dec 2018 09:50:19 +0000 (UTC) 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= 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 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 X-ZohoMailClient: External X-Mailman-Approved-At: Mon, 17 Dec 2018 07:50:40 +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: chengnt@lenovo.com, Huaisheng Ye , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Huaisheng Ye There are compiler warnings within functions 'dcn10_log_hubbub_state’ and 'dcn10_get_hubbub_state’. This patch avoids the compiler reports the following warning when building amdgpu.ko. drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c: In function ‘dcn10_log_hubbub_state’: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:94:9: warning: missing braces around initializer [-Wmissing-braces] struct dcn_hubbub_wm wm = {0}; ^ drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:94:9: warning: (near initialization for ‘wm.sets’) [-Wmissing-braces] drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer_debug.c: In function ‘dcn10_get_hubbub_state’: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer_debug.c:74:9: warning: missing braces around initializer [-Wmissing-braces] struct dcn_hubbub_wm wm = {0}; ^ drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer_debug.c:74:9: warning: (near initialization for ‘wm.sets’) [-Wmissing-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/drivers/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_ctx) { struct dc_context *dc_ctx = dc->ctx; - struct dcn_hubbub_wm wm = {0}; + struct dcn_hubbub_wm wm; int i; + memset(&wm, 0, sizeof(struct dcn_hubbub_wm)); hubbub1_wm_read_state(dc->res_pool->hubbub, &wm); DTN_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 int bufSize, char *fmt, static unsigned int dcn10_get_hubbub_state(struct dc *dc, char *pBuf, unsigned int bufSize) { struct dc_context *dc_ctx = dc->ctx; - struct dcn_hubbub_wm wm = {0}; + struct dcn_hubbub_wm wm; int i; unsigned int chars_printed = 0; @@ -80,6 +80,7 @@ static unsigned int dcn10_get_hubbub_state(struct dc *dc, char *pBuf, unsigned i const uint32_t ref_clk_mhz = dc_ctx->dc->res_pool->ref_clock_inKhz / 1000; static const unsigned int frac = 1000; + memset(&wm, 0, sizeof(struct dcn_hubbub_wm)); hubbub1_wm_read_state(dc->res_pool->hubbub, &wm); chars_printed = snprintf_count(pBuf, remaining_buffer, "wm_set_index,data_urgent,pte_meta_urgent,sr_enter,sr_exit,dram_clk_chanage\n");