cpuidle: teo: Drop local variable prev_intercept_idx
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 13 Jan 2025 18:40:49 +0000 (19:40 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 20 Jan 2025 16:16:37 +0000 (17:16 +0100)
commitb9a6af26bd83fb23d15c53b1ce63df77dda15513
tree810d03e6124b48820f83d844ab6a9321f2b8d3f1
parentea185406d1ed90493ef0868a03ddcb6b2701b11b
cpuidle: teo: Drop local variable prev_intercept_idx

Local variable prev_intercept_idx in teo_select() is redundant because
it cannot be 0 when candidate state index is 0.

The prev_intercept_idx value is the index of the deepest enabled idle
state, so if it is 0, state 0 is the deepest enabled idle state, in
which case it must be the only enabled idle state, but then teo_select()
would have returned early before initializing prev_intercept_idx.

Thus prev_intercept_idx must be nonzero and the check of it against 0
always passes, so it can be dropped altogether.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/3327997.aeNJFYEL58@rjwysocki.net
[ rjw: Fixed typo in the changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpuidle/governors/teo.c