cpufreq: intel_pstate: Remove sample parameter in intel_pstate_calc_busy
Subsystems (2)
PATCH 1/1 cpufreq: 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.
--- drivers/cpufreq/intel_pstate.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/cpufreq/intel_pstate.c +4 -7
@@ -32,8 +32,6 @@#include <asm/msr.h> #include <asm/cpu_device_id.h> -#define SAMPLE_COUNT 3 -#define BYT_RATIOS 0x66a#define BYT_VIDS 0x66b#define BYT_TURBO_RATIOS 0x66c
@@ -553,14 +551,13 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu)intel_pstate_set_pstate (cpu, cpu->pstate.max_pstate); } -static inline void intel_pstate_calc_busy (struct cpudata *cpu, -struct sample *sample) +static inline void intel_pstate_calc_busy (struct cpudata *cpu) { +struct sample *sample = &cpu->sample;int32_t core_pct;int32_t c0_pct; - core_pct =div_fp (int_tofp ((sample->aperf)), -int_tofp ((sample->mperf))); + core_pct =div_fp (int_tofp (sample->aperf),int_tofp (sample->mperf)); core_pct =mul_fp (core_pct,int_tofp (100 ));FP_ROUNDUP (core_pct);
@@ -595,7 +592,7 @@ static inline void intel_pstate_sample(struct cpudata *cpu) cpu->sample.mperf -= cpu->prev_mperf; cpu->sample.tsc -= cpu->prev_tsc; -intel_pstate_calc_busy (cpu, &cpu->sample); +intel_pstate_calc_busy (cpu); cpu->prev_aperf = aperf; cpu->prev_mperf = mperf;
Signature · 1 line
1.9.0
Quoted 11 lines · Stratos Karafotis
Since commit
d37e2b7644("intel_pstate: remove unneeded sample buffers") we use only one sample. So, there is no need to pass the sample pointer tointel_pstate_calc_busy. Instead, get the pointer from cpudata. Also, remove the unusedSAMPLE_COUNTmacro.While at it, reformat the first line in this function.
Signed-off-by Stratos Karafotis <[email protected]>--- drivers/cpufreq/intel_pstate.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
Quoted 8 lines · Stratos Karafotis
Since commit
d37e2b7644("intel_pstate: remove unneeded sample buffers") we use only one sample. So, there is no need to pass the sample pointer tointel_pstate_calc_busy. Instead, get the pointer from cpudata. Also, remove the unusedSAMPLE_COUNTmacro.While at it, reformat the first line in this function.
Signed-off-by Stratos Karafotis <[email protected]>
Quoted 45 lines
--- drivers/cpufreq/intel_pstate.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)drivers/cpufreq/intel_pstate.c +4
-7@@ -32,8 +32,6 @@#include <asm/msr.h> #include <asm/cpu_device_id.h> -#define SAMPLE_COUNT 3 -#define BYT_RATIOS 0x66a#define BYT_VIDS 0x66b#define BYT_TURBO_RATIOS 0x66c@@ -553,14 +551,13 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu)intel_pstate_set_pstate (cpu, cpu->pstate.max_pstate); } -static inline void intel_pstate_calc_busy (struct cpudata *cpu, -struct sample *sample) +static inline void intel_pstate_calc_busy (struct cpudata *cpu) { +struct sample *sample = &cpu->sample;int32_t core_pct;int32_t c0_pct; - core_pct =div_fp (int_tofp ((sample->aperf)), -int_tofp ((sample->mperf))); + core_pct =div_fp (int_tofp (sample->aperf),int_tofp (sample->mperf)); core_pct =mul_fp (core_pct,int_tofp (100 ));FP_ROUNDUP (core_pct);@@ -595,7 +592,7 @@ static inline void intel_pstate_sample(struct cpudata *cpu) cpu->sample.mperf -= cpu->prev_mperf; cpu->sample.tsc -= cpu->prev_tsc; -intel_pstate_calc_busy (cpu, &cpu->sample); +intel_pstate_calc_busy (cpu); cpu->prev_aperf = aperf; cpu->prev_mperf = mperf;