cpufreq: CPPC: Pass structure instance by reference
Don't pass structure instance by value, pass it by reference instead. Tested-by: Vincent Guittot <vincent.guittot@linaro.org> Reviewed-by: Ionela Voinescu <ionela.voinescu@arm.com> Tested-by: Qian Cai <quic_qiancai@quicinc.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
This commit is contained in:
parent
fe2535a449
commit
eead1840cb
@ -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)
|
|||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user