diff options
author | Tuukka Tikkanen <idlestat@tic0.net> | 2015-03-12 10:43:30 +0200 |
---|---|---|
committer | Amit Kucheria <amit.kucheria@linaro.org> | 2015-03-12 17:08:11 +0530 |
commit | e6885f6fcaa8c5be8157a5b4bafc5834de1aebce (patch) | |
tree | af02f5ab540b566d8981cf26efbb228a38cb9955 /idlestat.c | |
parent | fed11f249681a6770a1efed5cc2a9ccacf199882 (diff) |
Fix merge_pstates
The function merge_pstates did not work as advertised. This patch fixes
the implementation.
Signed-off-by: Tuukka Tikkanen <idlestat@tic0.net>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Diffstat (limited to 'idlestat.c')
-rw-r--r-- | idlestat.c | 20 |
1 files changed, 5 insertions, 15 deletions
@@ -696,21 +696,11 @@ static void merge_pstates(struct cpuidle_datas *datas, percpu_a = &(datas->pstates[cpu]); percpu_b = &(baseline->pstates[cpu]); - for (idx = 0; idx < percpu_a->max && idx < percpu_b->max; ) { - if (percpu_a->pstate[idx].freq > - percpu_b->pstate[idx].freq) { - assert(alloc_pstate(percpu_b, - percpu_a->pstate[idx].freq) == idx); - continue; - } - if (percpu_a->pstate[idx].freq < - percpu_b->pstate[idx].freq) { - assert(alloc_pstate(percpu_a, - percpu_b->pstate[idx].freq) == idx); - continue; - } - ++idx; - } + for (idx = 0; idx < percpu_a->max; ++idx) + alloc_pstate(percpu_b, percpu_a->pstate[idx].freq); + + for (idx = 0; idx < percpu_b->max; ++idx) + alloc_pstate(percpu_a, percpu_b->pstate[idx].freq); } } |