Skip to content

Commit

Permalink
drm/amd/display: drop redundant memset() in get_available_dsc_slices()
Browse files Browse the repository at this point in the history
get_available_dsc_slices() returns the number of indices set, and all of
the users of get_available_dsc_slices() don't cross the returned bound
when iterating over available_slices[]. So, the memset() in
get_available_dsc_slices() is redundant and can be dropped.

Fixes: 97bda03 ("drm/amd/display: Add DSC support for Navi (v2)")
Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Hamza Mahfooz authored and Alex Deucher committed Jun 9, 2023
1 parent e602157 commit 48dd83c
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,6 @@ static int get_available_dsc_slices(union dsc_enc_slice_caps slice_caps, int *av
{
int idx = 0;

memset(available_slices, -1, MIN_AVAILABLE_SLICES_SIZE);

if (slice_caps.bits.NUM_SLICES_1)
available_slices[idx++] = 1;

Expand Down

0 comments on commit 48dd83c

Please sign in to comment.