From: Hamza Mahfooz <hamza.mahfooz@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: "Hamza Mahfooz" <hamza.mahfooz@amd.com>,
"Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
"Harry Wentland" <harry.wentland@amd.com>,
"Leo Li" <sunpeng.li@amd.com>,
"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Qingqing Zhuo" <qingqing.zhuo@amd.com>,
"Aurabindo Pillai" <aurabindo.pillai@amd.com>,
"Hans de Goede" <hdegoede@redhat.com>,
"Hersen Wu" <hersenxs.wu@amd.com>,
"Stylon Wang" <stylon.wang@amd.com>, "Jun Lei" <Jun.Lei@amd.com>,
"Wenjing Liu" <wenjing.liu@amd.com>,
"Leon Huang" <Leon.Huang1@amd.com>,
"Mike Hsieh" <Mike.Hsieh@amd.com>,
"Cruise Hung" <Cruise.Hung@amd.com>,
"Nasir Osman" <nasir.osman@amd.com>,
pengfuyuan <pengfuyuan@kylinos.cn>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] drm/amd/display: drop redundant memset() in get_available_dsc_slices()
Date: Wed, 17 May 2023 14:33:45 -0400 [thread overview]
Message-ID: <20230517183350.314082-1-hamza.mahfooz@amd.com> (raw)
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
next reply other threads:[~2023-05-17 18:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 18:33 Hamza Mahfooz [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230517183350.314082-1-hamza.mahfooz@amd.com \
--to=hamza.mahfooz@amd.com \
--cc=Cruise.Hung@amd.com \
--cc=Jun.Lei@amd.com \
--cc=Leon.Huang1@amd.com \
--cc=Mike.Hsieh@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aurabindo.pillai@amd.com \
--cc=christian.koenig@amd.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=hdegoede@redhat.com \
--cc=hersenxs.wu@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nasir.osman@amd.com \
--cc=pengfuyuan@kylinos.cn \
--cc=qingqing.zhuo@amd.com \
--cc=stylon.wang@amd.com \
--cc=sunpeng.li@amd.com \
--cc=wenjing.liu@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox