Skip to content

Commit 9a41e16

Browse files
committed
cpuidle: teo: Drop utilized from struct teo_cpu
Because the utilized field in struct teo_cpu is only used locally in teo_select(), replace it with a local variable in that function. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-and-tested-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
1 parent 04bae4e commit 9a41e16

File tree

1 file changed

+4
-5
lines changed
  • drivers/cpuidle/governors

1 file changed

+4
-5
lines changed

drivers/cpuidle/governors/teo.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ struct teo_bin {
187187
* @next_recent_idx: Index of the next @recent_idx entry to update.
188188
* @recent_idx: Indices of bins corresponding to recent "intercepts".
189189
* @util_threshold: Threshold above which the CPU is considered utilized
190-
* @utilized: Whether the last sleep on the CPU happened while utilized
191190
*/
192191
struct teo_cpu {
193192
s64 time_span_ns;
@@ -197,7 +196,6 @@ struct teo_cpu {
197196
int next_recent_idx;
198197
int recent_idx[NR_RECENT];
199198
unsigned long util_threshold;
200-
bool utilized;
201199
};
202200

203201
static DEFINE_PER_CPU(struct teo_cpu, teo_cpus);
@@ -366,6 +364,7 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
366364
int idx0 = 0, idx = -1;
367365
bool alt_intercepts, alt_recent;
368366
ktime_t delta_tick;
367+
bool cpu_utilized;
369368
s64 duration_ns;
370369
int i;
371370

@@ -391,13 +390,13 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
391390
goto out_tick;
392391
}
393392

394-
cpu_data->utilized = teo_cpu_is_utilized(dev->cpu, cpu_data);
393+
cpu_utilized = teo_cpu_is_utilized(dev->cpu, cpu_data);
395394
/*
396395
* If the CPU is being utilized over the threshold and there are only 2
397396
* states to choose from, the metrics need not be considered, so choose
398397
* the shallowest non-polling state and exit.
399398
*/
400-
if (drv->state_count < 3 && cpu_data->utilized) {
399+
if (drv->state_count < 3 && cpu_utilized) {
401400
/* The CPU is utilized, so assume a short idle duration. */
402401
duration_ns = teo_middle_of_bin(0, drv);
403402
/*
@@ -562,7 +561,7 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
562561
* been stopped already and the shallower state's target residency is
563562
* not sufficiently large.
564563
*/
565-
if (cpu_data->utilized) {
564+
if (cpu_utilized) {
566565
s64 span_ns;
567566

568567
i = teo_find_shallower_state(drv, dev, idx, duration_ns, true);

0 commit comments

Comments
 (0)