]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Initialize stream_update with memset
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Fri, 22 Mar 2019 13:59:32 +0000 (09:59 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:35 +0000 (06:43 -0700)
[ Upstream commit 2aa632c5ffbedb2ee0e68857683466ea788f17eb ]

The brace initialization used here generates warnings on some
compilers. For example, on GCC 4.9:

[...] In function ‘dm_determine_update_type_for_commit’:
[...] error: missing braces around initializer [-Werror=missing-braces]
   struct dc_stream_update stream_update = { 0 };
          ^

Use memset to make this more portable.

v2: Specify the compiler / diagnostic in the commit message (Paul)

Cc: Sun peng Li <Sunpeng.Li@amd.com>
Cc: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 3082b55b1e774fd31b4293c402c41174df28e9a9..66f19d1864b173a955f8f1062e41c4a97a98897b 100644 (file)
@@ -5858,7 +5858,9 @@ dm_determine_update_type_for_commit(struct dc *dc,
        }
 
        for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
-               struct dc_stream_update stream_update = { 0 };
+               struct dc_stream_update stream_update;
+
+               memset(&stream_update, 0, sizeof(stream_update));
 
                new_dm_crtc_state = to_dm_crtc_state(new_crtc_state);
                old_dm_crtc_state = to_dm_crtc_state(old_crtc_state);