diff options
author | Stratos Karafotis <stratosk@semaphore.gr> | 2014-04-29 13:53:49 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-05-06 18:29:51 -0400 |
commit | 6b17ddb2a50b9403c6948ec3e4ea2bd2d7064ff3 (patch) | |
tree | e5901ec21bbf82569076a6acebe456713ed42e4f | |
parent | 735dc2498bd97b22e465dd4054d1b7edb9f63ed2 (diff) |
intel_pstate: Remove sample parameter in intel_pstate_calc_busy
Since commit d37e2b7644 ("intel_pstate: remove unneeded sample buffers")
we use only one sample. So, there is no need to pass the sample
pointer to intel_pstate_calc_busy. Instead, get the pointer from
cpudata. Also, remove the unused SAMPLE_COUNT macro.
While at it, reformat the first line in this function.
Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/cpufreq/intel_pstate.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 099967302bf2..6658bef99352 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
@@ -32,8 +32,6 @@ | |||
32 | #include <asm/msr.h> | 32 | #include <asm/msr.h> |
33 | #include <asm/cpu_device_id.h> | 33 | #include <asm/cpu_device_id.h> |
34 | 34 | ||
35 | #define SAMPLE_COUNT 3 | ||
36 | |||
37 | #define BYT_RATIOS 0x66a | 35 | #define BYT_RATIOS 0x66a |
38 | #define BYT_VIDS 0x66b | 36 | #define BYT_VIDS 0x66b |
39 | #define BYT_TURBO_RATIOS 0x66c | 37 | #define BYT_TURBO_RATIOS 0x66c |
@@ -553,14 +551,13 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) | |||
553 | intel_pstate_set_pstate(cpu, cpu->pstate.max_pstate); | 551 | intel_pstate_set_pstate(cpu, cpu->pstate.max_pstate); |
554 | } | 552 | } |
555 | 553 | ||
556 | static inline void intel_pstate_calc_busy(struct cpudata *cpu, | 554 | static inline void intel_pstate_calc_busy(struct cpudata *cpu) |
557 | struct sample *sample) | ||
558 | { | 555 | { |
556 | struct sample *sample = &cpu->sample; | ||
559 | int32_t core_pct; | 557 | int32_t core_pct; |
560 | int32_t c0_pct; | 558 | int32_t c0_pct; |
561 | 559 | ||
562 | core_pct = div_fp(int_tofp((sample->aperf)), | 560 | core_pct = div_fp(int_tofp(sample->aperf), int_tofp(sample->mperf)); |
563 | int_tofp((sample->mperf))); | ||
564 | core_pct = mul_fp(core_pct, int_tofp(100)); | 561 | core_pct = mul_fp(core_pct, int_tofp(100)); |
565 | FP_ROUNDUP(core_pct); | 562 | FP_ROUNDUP(core_pct); |
566 | 563 | ||
@@ -592,7 +589,7 @@ static inline void intel_pstate_sample(struct cpudata *cpu) | |||
592 | cpu->sample.mperf -= cpu->prev_mperf; | 589 | cpu->sample.mperf -= cpu->prev_mperf; |
593 | cpu->sample.tsc -= cpu->prev_tsc; | 590 | cpu->sample.tsc -= cpu->prev_tsc; |
594 | 591 | ||
595 | intel_pstate_calc_busy(cpu, &cpu->sample); | 592 | intel_pstate_calc_busy(cpu); |
596 | 593 | ||
597 | cpu->prev_aperf = aperf; | 594 | cpu->prev_aperf = aperf; |
598 | cpu->prev_mperf = mperf; | 595 | cpu->prev_mperf = mperf; |