<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of S, Shirish <Shirish.S@amd.com><br>
<b>Sent:</b> Thursday, December 20, 2018 9:01:04 AM<br>
<b>To:</b> Li, Sun peng (Leo); Wentland, Harry; Deucher, Alexander; Koenig, Christian<br>
<b>Cc:</b> amd-gfx@lists.freedesktop.org; S, Shirish<br>
<b>Subject:</b> [PATCH] drm/amd/display: fix compliler errors [-Werror,-Wmissing-braces]</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Initializing structures with { } is known to be problematic since<br>
it doesn't necessararily initializes all bytes, in case of padding,<br>
causing random failures when structures are memcmp().<br>
<br>
This patch fixes the structure initialisation compiler error by memsetting<br>
the entire structure elements instead of only the first one.<br>
<br>
Signed-off-by: Shirish S <shirish.s@amd.com><br>
---<br>
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 ++-<br>
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c | 3 ++-<br>
2 files changed, 4 insertions(+), 2 deletions(-)<br>
<br>
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<br>
index 0bd33a7..1b5630f 100644<br>
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c<br>
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c<br>
@@ -92,9 +92,10 @@ static void log_mpc_crc(struct dc *dc,<br>
void dcn10_log_hubbub_state(struct dc *dc, struct dc_log_buffer_ctx *log_ctx)<br>
{<br>
struct dc_context *dc_ctx = dc->ctx;<br>
- struct dcn_hubbub_wm wm = {0};<br>
+ struct dcn_hubbub_wm wm;<br>
int i;<br>
<br>
+ memset(&wm, 0, sizeof(struct dcn_hubbub_wm));<br>
hubbub1_wm_read_state(dc->res_pool->hubbub, &wm);<br>
<br>
DTN_INFO("HUBBUB WM: data_urgent pte_meta_urgent"<br>
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<br>
index cd46901..3fccec2 100644<br>
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c<br>
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer_debug.c<br>
@@ -72,7 +72,7 @@ static unsigned int snprintf_count(char *pBuf, unsigned int bufSize, char *fmt,<br>
static unsigned int dcn10_get_hubbub_state(struct dc *dc, char *pBuf, unsigned int bufSize)<br>
{<br>
struct dc_context *dc_ctx = dc->ctx;<br>
- struct dcn_hubbub_wm wm = {0};<br>
+ struct dcn_hubbub_wm wm;<br>
int i;<br>
<br>
unsigned int chars_printed = 0;<br>
@@ -81,6 +81,7 @@ static unsigned int dcn10_get_hubbub_state(struct dc *dc, char *pBuf, unsigned i<br>
const uint32_t ref_clk_mhz = dc_ctx->dc->res_pool->ref_clock_inKhz / 1000;<br>
static const unsigned int frac = 1000;<br>
<br>
+ memset(&wm, 0, sizeof(struct dcn_hubbub_wm));<br>
hubbub1_wm_read_state(dc->res_pool->hubbub, &wm);<br>
<br>
chars_printed = snprintf_count(pBuf, remaining_buffer, "wm_set_index,data_urgent,pte_meta_urgent,sr_enter,sr_exit,dram_clk_chanage\n");<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>