Skip to content

Commit 6b17ddb

Browse files
Stratos Karafotisrafaeljw
authored andcommitted
intel_pstate: Remove sample parameter in intel_pstate_calc_busy
Since commit d37e2b7 ("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>
1 parent 735dc24 commit 6b17ddb

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

‎drivers/cpufreq/intel_pstate.c‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
#include <asm/msr.h>
3333
#include <asm/cpu_device_id.h>
3434

35-
#define SAMPLE_COUNT 3
36-
3735
#define BYT_RATIOS 0x66a
3836
#define BYT_VIDS 0x66b
3937
#define BYT_TURBO_RATIOS 0x66c
@@ -553,14 +551,13 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu)
553551
intel_pstate_set_pstate(cpu, cpu->pstate.max_pstate);
554552
}
555553

556-
static inline void intel_pstate_calc_busy(struct cpudata *cpu,
557-
struct sample *sample)
554+
static inline void intel_pstate_calc_busy(struct cpudata *cpu)
558555
{
556+
struct sample *sample = &cpu->sample;
559557
int32_t core_pct;
560558
int32_t c0_pct;
561559

562-
core_pct = div_fp(int_tofp((sample->aperf)),
563-
int_tofp((sample->mperf)));
560+
core_pct = div_fp(int_tofp(sample->aperf), int_tofp(sample->mperf));
564561
core_pct = mul_fp(core_pct, int_tofp(100));
565562
FP_ROUNDUP(core_pct);
566563

@@ -592,7 +589,7 @@ static inline void intel_pstate_sample(struct cpudata *cpu)
592589
cpu->sample.mperf -= cpu->prev_mperf;
593590
cpu->sample.tsc -= cpu->prev_tsc;
594591

595-
intel_pstate_calc_busy(cpu, &cpu->sample);
592+
intel_pstate_calc_busy(cpu);
596593

597594
cpu->prev_aperf = aperf;
598595
cpu->prev_mperf = mperf;

0 commit comments

Comments
 (0)