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

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Jiapeng Chong and committed by
Alex Deucher
8866d627 49017304

+2 -6
+2 -6
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 352 352 int planes_count) 353 353 { 354 354 int i, j; 355 - struct dc_surface_update surface_updates_temp; 356 355 357 - for (i = 0, j = planes_count - 1; i < j; i++, j--) { 358 - surface_updates_temp = array_of_surface_update[i]; 359 - array_of_surface_update[i] = array_of_surface_update[j]; 360 - array_of_surface_update[j] = surface_updates_temp; 361 - } 356 + for (i = 0, j = planes_count - 1; i < j; i++, j--) 357 + swap(array_of_surface_update[i], array_of_surface_update[j]); 362 358 } 363 359 364 360 /**