cpufreq: governor: Drop cpu argument from dbs_check_cpu()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 6 Feb 2016 12:50:24 +0000 (13:50 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 9 Mar 2016 13:40:55 +0000 (14:40 +0100)
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>
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_governor.c
drivers/cpufreq/cpufreq_governor.h
drivers/cpufreq/cpufreq_ondemand.c

index b2df5de6cf92ecfa0cca9f89b6e0c407ca8dcf9a..b8054e53a37e9e3907fd62c429e6f6e49c03dd1b 100644 (file)
@@ -107,7 +107,7 @@ static unsigned int cs_dbs_timer(struct cpufreq_policy *policy)
        struct dbs_data *dbs_data = policy->governor_data;
        struct cs_dbs_tuners *cs_tuners = dbs_data->tuners;
 
-       dbs_check_cpu(policy, policy->cpu);
+       dbs_check_cpu(policy);
        return delay_for_sampling_rate(cs_tuners->sampling_rate);
 }
 
index b425cd3da6829c669e63dfafee4f622c13791a0b..431d81f7963c533da69382c4e24b440dd10c9342 100644 (file)
@@ -31,8 +31,9 @@ static struct attribute_group *get_sysfs_attr(struct dbs_governor *gov)
                gov->attr_group_gov_pol : gov->attr_group_gov_sys;
 }
 
-void dbs_check_cpu(struct cpufreq_policy *policy, int cpu)
+void dbs_check_cpu(struct cpufreq_policy *policy)
 {
+       int cpu = policy->cpu;
        struct dbs_governor *gov = dbs_governor_of(policy);
        struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(cpu);
        struct dbs_data *dbs_data = policy->governor_data;
@@ -517,8 +518,7 @@ static int cpufreq_governor_stop(struct cpufreq_policy *policy)
 static int cpufreq_governor_limits(struct cpufreq_policy *policy)
 {
        struct dbs_governor *gov = dbs_governor_of(policy);
-       unsigned int cpu = policy->cpu;
-       struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(cpu);
+       struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(policy->cpu);
 
        /* State should be equivalent to START */
        if (!cdbs->policy_dbs || !cdbs->policy_dbs->policy)
@@ -531,7 +531,7 @@ static int cpufreq_governor_limits(struct cpufreq_policy *policy)
        else if (policy->min > cdbs->policy_dbs->policy->cur)
                __cpufreq_driver_target(cdbs->policy_dbs->policy, policy->min,
                                        CPUFREQ_RELATION_L);
-       dbs_check_cpu(policy, cpu);
+       dbs_check_cpu(policy);
        mutex_unlock(&cdbs->policy_dbs->timer_mutex);
 
        return 0;
index c90a2d3766fd15ec38270cf4e53bc120acd8faf5..63868d7f14f586ca40d662bd8a728d928f8abee9 100644 (file)
@@ -279,7 +279,7 @@ static ssize_t show_sampling_rate_min_gov_pol                               \
 
 extern struct mutex dbs_data_mutex;
 extern struct mutex cpufreq_governor_lock;
-void dbs_check_cpu(struct cpufreq_policy *policy, int cpu);
+void dbs_check_cpu(struct cpufreq_policy *policy);
 int cpufreq_governor_dbs(struct cpufreq_policy *policy, unsigned int event);
 void od_register_powersave_bias_handler(unsigned int (*f)
                (struct cpufreq_policy *, unsigned int, unsigned int),
index 4a2332733cca114a5ffe7deb83fd554a663f62ae..9ef4402644c7c8f69b170190e937fe9ce80f57fc 100644 (file)
@@ -190,9 +190,7 @@ static void od_check_cpu(int cpu, unsigned int load)
 static unsigned int od_dbs_timer(struct cpufreq_policy *policy)
 {
        struct dbs_data *dbs_data = policy->governor_data;
-       unsigned int cpu = policy->cpu;
-       struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info,
-                       cpu);
+       struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, policy->cpu);
        struct od_dbs_tuners *od_tuners = dbs_data->tuners;
        int delay = 0, sample_type = dbs_info->sample_type;
 
@@ -203,7 +201,7 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy)
                __cpufreq_driver_target(policy, dbs_info->freq_lo,
                                        CPUFREQ_RELATION_H);
        } else {
-               dbs_check_cpu(policy, cpu);
+               dbs_check_cpu(policy);
                if (dbs_info->freq_lo) {
                        /* Setup timer for SUB_SAMPLE */
                        dbs_info->sample_type = OD_SUB_SAMPLE;