Commit eead1840 authored by Viresh Kumar's avatar Viresh Kumar

cpufreq: CPPC: Pass structure instance by reference

Don't pass structure instance by value, pass it by reference instead.
Tested-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
Tested-by: default avatarQian Cai <quic_qiancai@quicinc.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent fe2535a4
...@@ -375,18 +375,18 @@ static inline u64 get_delta(u64 t1, u64 t0) ...@@ -375,18 +375,18 @@ static inline u64 get_delta(u64 t1, u64 t0)
} }
static int cppc_get_rate_from_fbctrs(struct cppc_cpudata *cpu_data, static int cppc_get_rate_from_fbctrs(struct cppc_cpudata *cpu_data,
struct cppc_perf_fb_ctrs fb_ctrs_t0, struct cppc_perf_fb_ctrs *fb_ctrs_t0,
struct cppc_perf_fb_ctrs fb_ctrs_t1) struct cppc_perf_fb_ctrs *fb_ctrs_t1)
{ {
u64 delta_reference, delta_delivered; u64 delta_reference, delta_delivered;
u64 reference_perf, delivered_perf; u64 reference_perf, delivered_perf;
reference_perf = fb_ctrs_t0.reference_perf; reference_perf = fb_ctrs_t0->reference_perf;
delta_reference = get_delta(fb_ctrs_t1.reference, delta_reference = get_delta(fb_ctrs_t1->reference,
fb_ctrs_t0.reference); fb_ctrs_t0->reference);
delta_delivered = get_delta(fb_ctrs_t1.delivered, delta_delivered = get_delta(fb_ctrs_t1->delivered,
fb_ctrs_t0.delivered); fb_ctrs_t0->delivered);
/* Check to avoid divide-by zero */ /* Check to avoid divide-by zero */
if (delta_reference || delta_delivered) if (delta_reference || delta_delivered)
...@@ -417,7 +417,7 @@ static unsigned int cppc_cpufreq_get_rate(unsigned int cpu) ...@@ -417,7 +417,7 @@ static unsigned int cppc_cpufreq_get_rate(unsigned int cpu)
if (ret) if (ret)
return ret; return ret;
return cppc_get_rate_from_fbctrs(cpu_data, fb_ctrs_t0, fb_ctrs_t1); return cppc_get_rate_from_fbctrs(cpu_data, &fb_ctrs_t0, &fb_ctrs_t1);
} }
static int cppc_cpufreq_set_boost(struct cpufreq_policy *policy, int state) static int cppc_cpufreq_set_boost(struct cpufreq_policy *policy, int state)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment