Skip to content

Commit 4f690bb

Browse files
committed
cpuidle: teo: Rename local variable in teo_select()
Rename a local variable in teo_select() in preparation for subsequent code modifications, no intentional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Cc: 5.1+ <[email protected]> # 5.1+
1 parent 069ce2e commit 4f690bb

File tree

1 file changed

+9
-10
lines changed
  • drivers/cpuidle/governors

1 file changed

+9
-10
lines changed

drivers/cpuidle/governors/teo.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
233233
{
234234
struct teo_cpu *cpu_data = per_cpu_ptr(&teo_cpus, dev->cpu);
235235
int latency_req = cpuidle_governor_latency_req(dev->cpu);
236-
unsigned int duration_us, count;
236+
unsigned int duration_us, early_hits;
237237
int max_early_idx, constraint_idx, idx, i;
238238
ktime_t delta_tick;
239239

@@ -247,7 +247,7 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
247247
cpu_data->sleep_length_ns = tick_nohz_get_sleep_length(&delta_tick);
248248
duration_us = ktime_to_us(cpu_data->sleep_length_ns);
249249

250-
count = 0;
250+
early_hits = 0;
251251
max_early_idx = -1;
252252
constraint_idx = drv->state_count;
253253
idx = -1;
@@ -270,12 +270,12 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
270270
* into account, because it would be a mistake to select
271271
* a deeper state with lower "early hits" metric. The
272272
* index cannot be changed to point to it, however, so
273-
* just increase the max count alone and let the index
274-
* still point to a shallower idle state.
273+
* just increase the "early hits" count alone and let
274+
* the index still point to a shallower idle state.
275275
*/
276276
if (max_early_idx >= 0 &&
277-
count < cpu_data->states[i].early_hits)
278-
count = cpu_data->states[i].early_hits;
277+
early_hits < cpu_data->states[i].early_hits)
278+
early_hits = cpu_data->states[i].early_hits;
279279

280280
continue;
281281
}
@@ -291,10 +291,10 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
291291

292292
idx = i;
293293

294-
if (count < cpu_data->states[i].early_hits &&
294+
if (early_hits < cpu_data->states[i].early_hits &&
295295
!(tick_nohz_tick_stopped() &&
296296
drv->states[i].target_residency < TICK_USEC)) {
297-
count = cpu_data->states[i].early_hits;
297+
early_hits = cpu_data->states[i].early_hits;
298298
max_early_idx = i;
299299
}
300300
}
@@ -323,10 +323,9 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
323323
if (idx < 0) {
324324
idx = 0; /* No states enabled. Must use 0. */
325325
} else if (idx > 0) {
326+
unsigned int count = 0;
326327
u64 sum = 0;
327328

328-
count = 0;
329-
330329
/*
331330
* Count and sum the most recent idle duration values less than
332331
* the current expected idle duration value.

0 commit comments

Comments
 (0)