diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2014-10-27 12:16:04 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2015-07-29 09:44:58 -0400 |
commit | 031a7f456adecaff692bc040b31a7d2262b4ee56 (patch) | |
tree | 1c8973c5d1e8a57350f1075f26db817105db2b9f | |
parent | e075867681ca9b8c0b8823e24d0fb4ce3b4f2655 (diff) |
apm32: Fix cputime == jiffies assumption
That code wrongly assumes that cputime_t wraps jiffies_t. Lets use
the correct accessors/mutators.
No real harm now as that code can't be used with full dynticks.
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc; John Stultz <john.stultz@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
-rw-r--r-- | arch/x86/kernel/apm_32.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index 927ec9235947..052c9c3026cc 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c | |||
@@ -919,7 +919,7 @@ recalc: | |||
919 | } else if (jiffies_since_last_check > idle_period) { | 919 | } else if (jiffies_since_last_check > idle_period) { |
920 | unsigned int idle_percentage; | 920 | unsigned int idle_percentage; |
921 | 921 | ||
922 | idle_percentage = stime - last_stime; | 922 | idle_percentage = cputime_to_jiffies(stime - last_stime); |
923 | idle_percentage *= 100; | 923 | idle_percentage *= 100; |
924 | idle_percentage /= jiffies_since_last_check; | 924 | idle_percentage /= jiffies_since_last_check; |
925 | use_apm_idle = (idle_percentage > idle_threshold); | 925 | use_apm_idle = (idle_percentage > idle_threshold); |