Skip to contentSkip to conversation

drm/amd/display: remove unused variable oldest_index

PATCH Applied Tom Rix 2 participants 2 messages Apr 14, 2023 – Apr 17, 2023

Subsystems (3)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 drm/amd/display: remove unused variable oldest_index

cpp_check reports drivers/gpu/drm/amd/display/modules/freesync/freesync.c:1143:17: style: Variable
'oldest_index' is assigned a value that is never used. [unreadVariable]

   oldest_index = 0;
                ^

This variable is not used so remove.

---
 drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +0 -4
index 5c41a4751db4..5798c0eafa1f 100644
@@ -1137,10 +1137,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
 
 	if (in_out_vrr->supported &&
 			in_out_vrr->state == VRR_STATE_ACTIVE_VARIABLE) {
-		unsigned int oldest_index = plane->time.index + 1;
-
-		if (oldest_index >= DC_PLANE_UPDATE_TIMES_MAX)
-			oldest_index = 0;
 
 		last_render_time_in_us = curr_time_stamp_in_us -
 				plane->time.prev_update_time_in_us;
Signature · 1 line
2.27.0
Applied
#1 lore raw

Applied. Thanks!

Quoted 32 lines · Tom Rix

cpp_check reports drivers/gpu/drm/amd/display/modules/freesync/freesync.c:1143:17: style: Variable
'oldest_index' is assigned a value that is never used. [unreadVariable]

   oldest_index = 0;
                ^

This variable is not used so remove.

---
 drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +0 -5
index 5c41a4751db4..5798c0eafa1f 100644
@@ -1137,10 +1137,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
 
        if (in_out_vrr->supported &&
                        in_out_vrr->state == VRR_STATE_ACTIVE_VARIABLE) {
-               unsigned int oldest_index = plane->time.index + 1;
-
-               if (oldest_index >= DC_PLANE_UPDATE_TIMES_MAX)
-                       oldest_index = 0;
 
                last_render_time_in_us = curr_time_stamp_in_us -
                                plane->time.prev_update_time_in_us;
--

2.27.0