From 04daea81fc151c75f2e6811be132b07322d4c536 Mon Sep 17 00:00:00 2001 From: Olav Haugan Date: Wed, 19 Oct 2016 10:35:52 -0700 Subject: [PATCH] sched/hmp: Fix range checking for target load The range check for target load is incorrect. Fix this. This is only a sanity check to catch badly specified target loads. Change-Id: Ia90d020f5e0bdf37c600661a1c246dab5b637b3b Signed-off-by: Olav Haugan --- kernel/sched/hmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/hmp.c b/kernel/sched/hmp.c index 3d5de8ba70a2..53f361ed0167 100644 --- a/kernel/sched/hmp.c +++ b/kernel/sched/hmp.c @@ -201,7 +201,7 @@ int sched_update_freq_max_load(const cpumask_t *cpumask) entry = &max_load->freqs[i]; freq = costs[i].freq; hpct = get_freq_max_load(cpu, freq); - if (hpct <= 0 && hpct > 100) + if (hpct <= 0 || hpct > 100) hpct = 100; hfreq = div64_u64((u64)freq * hpct, 100); entry->hdemand =