mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
drm/amd/display: use swap() in update_phy_id_mapping()
Use existing swap() function rather than duplicating its implementation. ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c:185:47-48: WARNING opportunity for swap(). ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c:125:53-54: WARNING opportunity for swap(). Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=12335 Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
69b54d7c7c
commit
6f685a8134
|
|
@ -120,11 +120,8 @@ static void update_phy_id_mapping(struct amdgpu_device *adev)
|
|||
for (idx = connector_cnt; idx > 1 ; idx--) {
|
||||
for (idx_2 = 0; idx_2 < (idx - 1); idx_2++) {
|
||||
if (sort_connector[idx_2]->dc_link->link_enc_hw_inst >
|
||||
sort_connector[idx_2 + 1]->dc_link->link_enc_hw_inst) {
|
||||
aconnector = sort_connector[idx_2];
|
||||
sort_connector[idx_2] = sort_connector[idx_2 + 1];
|
||||
sort_connector[idx_2 + 1] = aconnector;
|
||||
}
|
||||
sort_connector[idx_2 + 1]->dc_link->link_enc_hw_inst)
|
||||
swap(sort_connector[idx_2], sort_connector[idx_2 + 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -180,11 +177,8 @@ static void update_phy_id_mapping(struct amdgpu_device *adev)
|
|||
}
|
||||
}
|
||||
|
||||
if (swap) {
|
||||
aconnector = sort_connector[j];
|
||||
sort_connector[j] = sort_connector[j + 1];
|
||||
sort_connector[j + 1] = aconnector;
|
||||
}
|
||||
if (swap)
|
||||
swap(sort_connector[j], sort_connector[j + 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user