drm/amd/display: Use memset to initialize variables in amdgpu_dm_atomic_commit_tail
Subsystems (3)
PATCH 1/1 drm/amd/display: Use memset to initialize variables in amdgpu_dm_atomic_commit_tail
Clang warns:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5089:60:
warning: suggest braces around initialization of subobject [-Wmissing-braces]
struct dc_surface_update dummy_updates[MAX_SURFACES] = { 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/[email protected]/
[2]: https://lore.kernel.org/lkml/[email protected]/
Fixes 02d6a6fcdf68 ("drm/amd/display: Simplify underscan and ABM commit")
Signed-off-by Nathan Chancellor <[email protected]>
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -2
@@ -5089,10 +5089,13 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)struct dm_connector_state *dm_new_con_state =to_dm_connector_state (new_con_state);struct dm_connector_state *dm_old_con_state =to_dm_connector_state (old_con_state);struct amdgpu_crtc *acrtc =to_amdgpu_crtc (dm_new_con_state->base.crtc); -struct dc_surface_update dummy_updates[MAX_SURFACES ] = {0 }; -struct dc_stream_update stream_update = {0 }; +struct dc_surface_update dummy_updates[MAX_SURFACES ]; +struct dc_stream_update stream_update;struct dc_stream_status *status =NULL ; +memset (&dummy_updates,0 ,sizeof (dummy_updates)); +memset (&stream_update,0 ,sizeof (stream_update)); +if (acrtc) { new_crtc_state =drm_atomic_get_new_crtc_state (state, &acrtc->base); old_crtc_state =drm_atomic_get_old_crtc_state (state, &acrtc->base);
Signature · 1 line
2.20.1