aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiapeng Chong <[email protected]>2024-06-24 09:57:07 +0800
committerAlex Deucher <[email protected]>2024-06-27 17:10:39 -0400
commite97db6d9f068098b35ff1f37db89826c77ea037e (patch)
tree0916a8169dc53f50728ca5ccd2f9fd95f1c0f685
parent68936346b67d8a4605d8b66f0d345d6bb1f95f4d (diff)
drm/amd/display: use swap() in is_config_schedulable()
Use existing swap() function rather than duplicating its implementation. ./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c:1171:103-104: WARNING opportunity for swap(). ./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c:1231:99-100: WARNING opportunity for swap(). Reported-by: Abaci Robot <[email protected]> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9400 Signed-off-by: Jiapeng Chong <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c b/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c
index 00fedc00a735..603036df68ba 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c
@@ -1163,7 +1163,6 @@ static bool is_config_schedulable(
schedulable = true;
/* sort disallow times from greatest to least */
- unsigned int temp;
for (i = 0; i < s->pmo_dcn4.num_timing_groups; i++) {
bool swapped = false;
@@ -1172,9 +1171,8 @@ static bool is_config_schedulable(
double jp1_disallow_us = s->pmo_dcn4.group_common_fams2_meta[s->pmo_dcn4.sorted_group_gtl_disallow_index[j + 1]].disallow_time_us;
if (j_disallow_us < jp1_disallow_us) {
/* swap as A < B */
- temp = s->pmo_dcn4.sorted_group_gtl_disallow_index[j];
- s->pmo_dcn4.sorted_group_gtl_disallow_index[j] = s->pmo_dcn4.sorted_group_gtl_disallow_index[j + 1];
- s->pmo_dcn4.sorted_group_gtl_disallow_index[j + 1] = temp;
+ swap(s->pmo_dcn4.sorted_group_gtl_disallow_index[j],
+ s->pmo_dcn4.sorted_group_gtl_disallow_index[j+1]);
swapped = true;
}
}
@@ -1232,9 +1230,8 @@ static bool is_config_schedulable(
double jp1_period_us = s->pmo_dcn4.group_common_fams2_meta[s->pmo_dcn4.sorted_group_gtl_period_index[j + 1]].period_us;
if (j_period_us < jp1_period_us) {
/* swap as A < B */
- temp = s->pmo_dcn4.sorted_group_gtl_period_index[j];
- s->pmo_dcn4.sorted_group_gtl_period_index[j] = s->pmo_dcn4.sorted_group_gtl_period_index[j + 1];
- s->pmo_dcn4.sorted_group_gtl_period_index[j + 1] = temp;
+ swap(s->pmo_dcn4.sorted_group_gtl_period_index[j],
+ s->pmo_dcn4.sorted_group_gtl_period_index[j+1]);
swapped = true;
}
}