cpufreq: CPPC: Pass structure instance by reference

Don't pass structure instance by value, pass it by reference instead.

Tested-by: Vincent Guittot <[email protected]>
Reviewed-by: Ionela Voinescu <[email protected]>
Tested-by: Qian Cai <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
This commit is contained in:
Viresh Kumar committed 2021-07-01 07:32:09 +05:30
1 parent fe2535a449
commit eead1840cb
1 file changed
+8 -8
+8 -8
View File
@@ -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,
struct cppc_perf_fb_ctrs fb_ctrs_t0,
struct cppc_perf_fb_ctrs fb_ctrs_t1)
struct cppc_perf_fb_ctrs *fb_ctrs_t0,
struct cppc_perf_fb_ctrs *fb_ctrs_t1)
{
u64 delta_reference, delta_delivered;
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,
fb_ctrs_t0.reference);
delta_delivered = get_delta(fb_ctrs_t1.delivered,
fb_ctrs_t0.delivered);
delta_reference = get_delta(fb_ctrs_t1->reference,
fb_ctrs_t0->reference);
delta_delivered = get_delta(fb_ctrs_t1->delivered,
fb_ctrs_t0->delivered);
/* Check to avoid divide-by zero */
if (delta_reference || delta_delivered)
@@ -417,7 +417,7 @@ static unsigned int cppc_cpufreq_get_rate(unsigned int cpu)
if (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)