aboutsummaryrefslogtreecommitdiff
path: root/idlestat.c
diff options
context:
space:
mode:
authorTuukka Tikkanen <idlestat@tic0.net>2015-03-12 10:43:30 +0200
committerAmit Kucheria <amit.kucheria@linaro.org>2015-03-12 17:08:11 +0530
commite6885f6fcaa8c5be8157a5b4bafc5834de1aebce (patch)
treeaf02f5ab540b566d8981cf26efbb228a38cb9955 /idlestat.c
parentfed11f249681a6770a1efed5cc2a9ccacf199882 (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.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/idlestat.c b/idlestat.c
index 22a9781..4d773f4 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -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);
}
}