public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/amd/display: drop redundant memset() in get_available_dsc_slices()
@ 2023-05-17 18:33 Hamza Mahfooz
  2023-05-17 18:33 ` [PATCH 2/3] drm/amd/display: drop unused function set_abm_event() Hamza Mahfooz
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Hamza Mahfooz @ 2023-05-17 18:33 UTC (permalink / raw)
  To: amd-gfx
  Cc: Hamza Mahfooz, Christophe JAILLET, Harry Wentland, Leo Li,
	Rodrigo Siqueira, Alex Deucher, Christian König, Pan, Xinhui,
	David Airlie, Daniel Vetter, Qingqing Zhuo, Aurabindo Pillai,
	Hans de Goede, Hersen Wu, Stylon Wang, Jun Lei, Wenjing Liu,
	Leon Huang, Mike Hsieh, Cruise Hung, Nasir Osman, pengfuyuan,
	dri-devel, linux-kernel

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>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
index b9a05bb025db..58dd62cce4bb 100644
--- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
+++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
@@ -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;
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-22 11:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-17 18:33 [PATCH 1/3] drm/amd/display: drop redundant memset() in get_available_dsc_slices() Hamza Mahfooz
2023-05-17 18:33 ` [PATCH 2/3] drm/amd/display: drop unused function set_abm_event() Hamza Mahfooz
2023-05-18  0:03   ` Rodrigo Siqueira Jordao
2023-05-17 18:33 ` [PATCH 3/3] drm/amd/display: drop unused count variable in create_eml_sink() Hamza Mahfooz
2023-05-18  0:04   ` Rodrigo Siqueira Jordao
2023-08-22 11:43   ` Jani Nikula
2023-05-18  0:01 ` [PATCH 1/3] drm/amd/display: drop redundant memset() in get_available_dsc_slices() Rodrigo Siqueira Jordao
2023-05-18  6:28 ` Marion & Christophe JAILLET

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox