Skip to content

Commit b18e0de

Browse files
committed
cpuidle: teo: Cosmetic modification of teo_select()
Initialize local variables in teo_select() where they are declared. No functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent f53cbda commit b18e0de

File tree

1 file changed

+7
-11
lines changed
  • drivers/cpuidle/governors

1 file changed

+7
-11
lines changed

drivers/cpuidle/governors/teo.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,15 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
241241
{
242242
struct teo_cpu *cpu_data = per_cpu_ptr(&teo_cpus, dev->cpu);
243243
s64 latency_req = cpuidle_governor_latency_req(dev->cpu);
244-
int max_early_idx, prev_max_early_idx, constraint_idx, idx0, idx, i;
245-
unsigned int hits, misses, early_hits;
244+
int constraint_idx = drv->state_count;
245+
unsigned int hits = 0, misses = 0;
246+
unsigned int early_hits = 0;
247+
int prev_max_early_idx = -1;
248+
int max_early_idx = -1;
249+
int idx0 = -1, idx = -1;
246250
ktime_t delta_tick;
247251
s64 duration_ns;
252+
int i;
248253

249254
if (dev->last_state_idx >= 0) {
250255
teo_update(drv, dev);
@@ -256,15 +261,6 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
256261
duration_ns = tick_nohz_get_sleep_length(&delta_tick);
257262
cpu_data->sleep_length_ns = duration_ns;
258263

259-
hits = 0;
260-
misses = 0;
261-
early_hits = 0;
262-
max_early_idx = -1;
263-
prev_max_early_idx = -1;
264-
constraint_idx = drv->state_count;
265-
idx = -1;
266-
idx0 = idx;
267-
268264
for (i = 0; i < drv->state_count; i++) {
269265
struct cpuidle_state *s = &drv->states[i];
270266

0 commit comments

Comments
 (0)