From: Hamza Mahfooz <hamza.mahfooz@amd.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, harry.wentland@amd.com
Cc: sunpeng.li@amd.com, Abaci Robot <abaci@linux.alibaba.com>,
Xinhui.Pan@amd.com, Rodrigo.Siqueira@amd.com,
linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
alexander.deucher@amd.com, airlied@gmail.com,
christian.koenig@amd.com
Subject: Re: [PATCH] drm/amd/display: Use swap() instead of open coding it
Date: Thu, 9 Mar 2023 10:03:58 -0500 [thread overview]
Message-ID: <e51d01a9-c678-18a8-b861-894315c872a9@amd.com> (raw)
In-Reply-To: <20230309025250.2534-1-jiapeng.chong@linux.alibaba.com>
On 3/8/23 21:52, Jiapeng Chong wrote:
> Swap is a function interface that provides exchange function. To avoid
> code duplication, we can use swap function.
>
> ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:359:57-58: WARNING opportunity for swap().
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4448
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Applied, thanks!
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index ae994c6c65ac..f6d9bbce15b2 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -352,13 +352,9 @@ static inline void reverse_planes_order(struct dc_surface_update *array_of_surfa
> int planes_count)
> {
> int i, j;
> - struct dc_surface_update surface_updates_temp;
>
> - for (i = 0, j = planes_count - 1; i < j; i++, j--) {
> - surface_updates_temp = array_of_surface_update[i];
> - array_of_surface_update[i] = array_of_surface_update[j];
> - array_of_surface_update[j] = surface_updates_temp;
> - }
> + for (i = 0, j = planes_count - 1; i < j; i++, j--)
> + swap(array_of_surface_update[i], array_of_surface_update[j]);
> }
>
> /**
--
Hamza
next prev parent reply other threads:[~2023-03-09 15:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-09 2:52 Jiapeng Chong
2023-03-09 15:03 ` Hamza Mahfooz [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-10-18 6:15 Jiapeng Chong
2022-06-24 6:25 Jiapeng Chong
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=e51d01a9-c678-18a8-b861-894315c872a9@amd.com \
--to=hamza.mahfooz@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=abaci@linux.alibaba.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sunpeng.li@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
all inboxes | Powered by JetHome®