Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: drop redundant memset() in get_available_dsc_slices()

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: 97bda0322b8a ("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>

authored by

Hamza Mahfooz and committed by
Alex Deucher
48dd83c0 e602157e

-2
-2
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
··· 645 645 { 646 646 int idx = 0; 647 647 648 - memset(available_slices, -1, MIN_AVAILABLE_SLICES_SIZE); 649 - 650 648 if (slice_caps.bits.NUM_SLICES_1) 651 649 available_slices[idx++] = 1; 652 650