mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/amd/display: Use swap() instead of open coding it
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> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
49017304c0
commit
8866d62716
@@ -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]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user