diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-02-06 07:50:24 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-03-09 08:40:55 -0500 |
commit | d10b5eb5fce436ba22443ab83eeb36e195dbf772 (patch) | |
tree | 69d4b67ea294fa056c5e583b82bedae1c42edb24 /drivers/cpufreq | |
parent | e40e7b255e591d0448500c7910ec5693f58026bd (diff) |
cpufreq: governor: Drop cpu argument from dbs_check_cpu()
Since policy->cpu is always passed as the second argument to
dbs_check_cpu(), it is not really necessary to pass it, because
the function can obtain that value via its first argument just fine.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq_conservative.c | 2 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_governor.c | 8 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_governor.h | 2 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 6 |
4 files changed, 8 insertions, 10 deletions
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index b2df5de6cf92..b8054e53a37e 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c | |||
@@ -107,7 +107,7 @@ static unsigned int cs_dbs_timer(struct cpufreq_policy *policy) | |||
107 | struct dbs_data *dbs_data = policy->governor_data; | 107 | struct dbs_data *dbs_data = policy->governor_data; |
108 | struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; | 108 | struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; |
109 | 109 | ||
110 | dbs_check_cpu(policy, policy->cpu); | 110 | dbs_check_cpu(policy); |
111 | return delay_for_sampling_rate(cs_tuners->sampling_rate); | 111 | return delay_for_sampling_rate(cs_tuners->sampling_rate); |
112 | } | 112 | } |
113 | 113 | ||
diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index b425cd3da682..431d81f7963c 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c | |||
@@ -31,8 +31,9 @@ static struct attribute_group *get_sysfs_attr(struct dbs_governor *gov) | |||
31 | gov->attr_group_gov_pol : gov->attr_group_gov_sys; | 31 | gov->attr_group_gov_pol : gov->attr_group_gov_sys; |
32 | } | 32 | } |
33 | 33 | ||
34 | void dbs_check_cpu(struct cpufreq_policy *policy, int cpu) | 34 | void dbs_check_cpu(struct cpufreq_policy *policy) |
35 | { | 35 | { |
36 | int cpu = policy->cpu; | ||
36 | struct dbs_governor *gov = dbs_governor_of(policy); | 37 | struct dbs_governor *gov = dbs_governor_of(policy); |
37 | struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(cpu); | 38 | struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(cpu); |
38 | struct dbs_data *dbs_data = policy->governor_data; | 39 | struct dbs_data *dbs_data = policy->governor_data; |
@@ -517,8 +518,7 @@ static int cpufreq_governor_stop(struct cpufreq_policy *policy) | |||
517 | static int cpufreq_governor_limits(struct cpufreq_policy *policy) | 518 | static int cpufreq_governor_limits(struct cpufreq_policy *policy) |
518 | { | 519 | { |
519 | struct dbs_governor *gov = dbs_governor_of(policy); | 520 | struct dbs_governor *gov = dbs_governor_of(policy); |
520 | unsigned int cpu = policy->cpu; | 521 | struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(policy->cpu); |
521 | struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(cpu); | ||
522 | 522 | ||
523 | /* State should be equivalent to START */ | 523 | /* State should be equivalent to START */ |
524 | if (!cdbs->policy_dbs || !cdbs->policy_dbs->policy) | 524 | if (!cdbs->policy_dbs || !cdbs->policy_dbs->policy) |
@@ -531,7 +531,7 @@ static int cpufreq_governor_limits(struct cpufreq_policy *policy) | |||
531 | else if (policy->min > cdbs->policy_dbs->policy->cur) | 531 | else if (policy->min > cdbs->policy_dbs->policy->cur) |
532 | __cpufreq_driver_target(cdbs->policy_dbs->policy, policy->min, | 532 | __cpufreq_driver_target(cdbs->policy_dbs->policy, policy->min, |
533 | CPUFREQ_RELATION_L); | 533 | CPUFREQ_RELATION_L); |
534 | dbs_check_cpu(policy, cpu); | 534 | dbs_check_cpu(policy); |
535 | mutex_unlock(&cdbs->policy_dbs->timer_mutex); | 535 | mutex_unlock(&cdbs->policy_dbs->timer_mutex); |
536 | 536 | ||
537 | return 0; | 537 | return 0; |
diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h index c90a2d3766fd..63868d7f14f5 100644 --- a/drivers/cpufreq/cpufreq_governor.h +++ b/drivers/cpufreq/cpufreq_governor.h | |||
@@ -279,7 +279,7 @@ static ssize_t show_sampling_rate_min_gov_pol \ | |||
279 | 279 | ||
280 | extern struct mutex dbs_data_mutex; | 280 | extern struct mutex dbs_data_mutex; |
281 | extern struct mutex cpufreq_governor_lock; | 281 | extern struct mutex cpufreq_governor_lock; |
282 | void dbs_check_cpu(struct cpufreq_policy *policy, int cpu); | 282 | void dbs_check_cpu(struct cpufreq_policy *policy); |
283 | int cpufreq_governor_dbs(struct cpufreq_policy *policy, unsigned int event); | 283 | int cpufreq_governor_dbs(struct cpufreq_policy *policy, unsigned int event); |
284 | void od_register_powersave_bias_handler(unsigned int (*f) | 284 | void od_register_powersave_bias_handler(unsigned int (*f) |
285 | (struct cpufreq_policy *, unsigned int, unsigned int), | 285 | (struct cpufreq_policy *, unsigned int, unsigned int), |
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 4a2332733cca..9ef4402644c7 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -190,9 +190,7 @@ static void od_check_cpu(int cpu, unsigned int load) | |||
190 | static unsigned int od_dbs_timer(struct cpufreq_policy *policy) | 190 | static unsigned int od_dbs_timer(struct cpufreq_policy *policy) |
191 | { | 191 | { |
192 | struct dbs_data *dbs_data = policy->governor_data; | 192 | struct dbs_data *dbs_data = policy->governor_data; |
193 | unsigned int cpu = policy->cpu; | 193 | struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, policy->cpu); |
194 | struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, | ||
195 | cpu); | ||
196 | struct od_dbs_tuners *od_tuners = dbs_data->tuners; | 194 | struct od_dbs_tuners *od_tuners = dbs_data->tuners; |
197 | int delay = 0, sample_type = dbs_info->sample_type; | 195 | int delay = 0, sample_type = dbs_info->sample_type; |
198 | 196 | ||
@@ -203,7 +201,7 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy) | |||
203 | __cpufreq_driver_target(policy, dbs_info->freq_lo, | 201 | __cpufreq_driver_target(policy, dbs_info->freq_lo, |
204 | CPUFREQ_RELATION_H); | 202 | CPUFREQ_RELATION_H); |
205 | } else { | 203 | } else { |
206 | dbs_check_cpu(policy, cpu); | 204 | dbs_check_cpu(policy); |
207 | if (dbs_info->freq_lo) { | 205 | if (dbs_info->freq_lo) { |
208 | /* Setup timer for SUB_SAMPLE */ | 206 | /* Setup timer for SUB_SAMPLE */ |
209 | dbs_info->sample_type = OD_SUB_SAMPLE; | 207 | dbs_info->sample_type = OD_SUB_SAMPLE; |