cpufreq: Drop freq-table param to cpufreq_frequency_table_target()
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 3 Jun 2016 05:28:49 +0000 (10:58 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 8 Jun 2016 22:58:06 +0000 (00:58 +0200)
The policy already has this pointer set, use it instead.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Documentation/cpu-freq/cpu-drivers.txt
drivers/cpufreq/amd_freq_sensitivity.c
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq_ondemand.c
drivers/cpufreq/freq_table.c
drivers/cpufreq/powernv-cpufreq.c
drivers/cpufreq/s3c24xx-cpufreq.c
drivers/cpufreq/s5pv210-cpufreq.c
include/linux/cpufreq.h

index decbb8cb55733ae3362d3d5f3a679f37ff56c7de..74e812f0719c4b8181e966ec6a75eb2015e530f0 100644 (file)
@@ -244,7 +244,6 @@ policy->max, and all other criteria are met. This is helpful for the
 ->verify call.
 
 int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
-                                   struct cpufreq_frequency_table *table,
                                    unsigned int target_freq,
                                    unsigned int relation,
                                    unsigned int *index);
index bc86816693a85559abe6c814429f354ed54cdafd..3bea1bb791a94188299fcbf2c8c7c4278b7f83d7 100644 (file)
@@ -92,8 +92,7 @@ static unsigned int amd_powersave_bias_target(struct cpufreq_policy *policy,
                        unsigned int index;
 
                        cpufreq_frequency_table_target(policy,
-                               policy->freq_table, policy->cur - 1,
-                               CPUFREQ_RELATION_H, &index);
+                               policy->cur - 1, CPUFREQ_RELATION_H, &index);
                        freq_next = policy->freq_table[index].frequency;
                }
 
index cc252eecc45a4bf3aa1fe64804b3bb6656a96956..a281446971289cccf29bf6b0e4347503e47c2e92 100644 (file)
@@ -1947,8 +1947,8 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
                return -EINVAL;
        }
 
-       retval = cpufreq_frequency_table_target(policy, freq_table, target_freq,
-                                               relation, &index);
+       retval = cpufreq_frequency_table_target(policy, target_freq, relation,
+                                               &index);
        if (unlikely(retval)) {
                pr_err("%s: Unable to find matching freq\n", __func__);
                return retval;
index 528353f204fd7e905670219d9c36df541408afae..2ee476f5a2bdb23ee3633a5dd9334e7ba1247b0c 100644 (file)
@@ -79,20 +79,19 @@ static unsigned int generic_powersave_bias_target(struct cpufreq_policy *policy,
                return freq_next;
        }
 
-       cpufreq_frequency_table_target(policy, freq_table, freq_next, relation,
-                                      &index);
+       cpufreq_frequency_table_target(policy, freq_next, relation, &index);
        freq_req = freq_table[index].frequency;
        freq_reduc = freq_req * od_tuners->powersave_bias / 1000;
        freq_avg = freq_req - freq_reduc;
 
        /* Find freq bounds for freq_avg in freq_table */
        index = 0;
-       cpufreq_frequency_table_target(policy, freq_table, freq_avg,
-                                      CPUFREQ_RELATION_H, &index);
+       cpufreq_frequency_table_target(policy, freq_avg, CPUFREQ_RELATION_H,
+                                      &index);
        freq_lo = freq_table[index].frequency;
        index = 0;
-       cpufreq_frequency_table_target(policy, freq_table, freq_avg,
-                                      CPUFREQ_RELATION_L, &index);
+       cpufreq_frequency_table_target(policy, freq_avg, CPUFREQ_RELATION_L,
+                                      &index);
        freq_hi = freq_table[index].frequency;
 
        /* Find out how long we have to be in hi and lo freqs */
index f52b5473b1f46ec1102504579482c575224c0b31..f145b64649ef762ea61c1ec7d342678617c573ab 100644 (file)
@@ -114,7 +114,6 @@ int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy)
 EXPORT_SYMBOL_GPL(cpufreq_generic_frequency_table_verify);
 
 int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
-                                  struct cpufreq_frequency_table *table,
                                   unsigned int target_freq,
                                   unsigned int relation,
                                   unsigned int *index)
@@ -128,6 +127,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
                .frequency = 0,
        };
        struct cpufreq_frequency_table *pos;
+       struct cpufreq_frequency_table *table = policy->freq_table;
        unsigned int freq, diff, i = 0;
 
        pr_debug("request for target %u kHz (relation: %u) for cpu %u\n",
index 54c45368e3f17d3333a124cbb378ccf0fefee9fe..bf267c2dfe20957fc6142a4d9ca079790079bfac 100644 (file)
@@ -760,8 +760,7 @@ void powernv_cpufreq_work_fn(struct work_struct *work)
                struct cpufreq_policy policy;
 
                cpufreq_get_policy(&policy, cpu);
-               cpufreq_frequency_table_target(&policy, policy.freq_table,
-                                              policy.cur,
+               cpufreq_frequency_table_target(&policy, policy.cur,
                                               CPUFREQ_RELATION_C, &index);
                powernv_cpufreq_target_index(&policy, index);
                cpumask_andnot(&mask, &mask, policy.cpus);
index 4567c3cab0956b31dc25fc5012d64c660880dd2d..05a9737278f3764bc5d9d9c26a6b393facc72e65 100644 (file)
@@ -293,9 +293,8 @@ static int s3c_cpufreq_target(struct cpufreq_policy *policy,
                     __func__, policy, target_freq, relation);
 
        if (ftab) {
-               if (cpufreq_frequency_table_target(policy, ftab,
-                                                  target_freq, relation,
-                                                  &index)) {
+               if (cpufreq_frequency_table_target(policy, target_freq,
+                                                  relation, &index)) {
                        s3c_freq_dbg("%s: table failed\n", __func__);
                        return -EINVAL;
                }
@@ -323,14 +322,14 @@ static int s3c_cpufreq_target(struct cpufreq_policy *policy,
                tmp_policy.min = policy->min * 1000;
                tmp_policy.max = policy->max * 1000;
                tmp_policy.cpu = policy->cpu;
+               tmp_policy.freq_table = pll_reg;
 
                /* cpufreq_frequency_table_target uses a pointer to 'index'
                 * which is the number of the table entry, not the value of
                 * the table entry's index field. */
 
-               ret = cpufreq_frequency_table_target(&tmp_policy, pll_reg,
-                                                    target_freq, relation,
-                                                    &index);
+               ret = cpufreq_frequency_table_target(&tmp_policy, target_freq,
+                                                    relation, &index);
 
                if (ret < 0) {
                        pr_err("%s: no PLL available\n", __func__);
index 06d85917b6d5d34f5e0aa862f3afd23dbedbe75a..6b0cfc3b8c466c83b702877a7972a9bf9b267304 100644 (file)
@@ -246,8 +246,7 @@ static int s5pv210_target(struct cpufreq_policy *policy, unsigned int index)
        new_freq = s5pv210_freq_table[index].frequency;
 
        /* Finding current running level index */
-       if (cpufreq_frequency_table_target(policy, s5pv210_freq_table,
-                                          old_freq, CPUFREQ_RELATION_H,
+       if (cpufreq_frequency_table_target(policy, old_freq, CPUFREQ_RELATION_H,
                                           &priv_index)) {
                ret = -EINVAL;
                goto exit;
index 1342cbc0f25e7129e9b0a5700d578b305168afdb..bdd7f0c035ae32faa208a0fb621111ac5a3fc1f7 100644 (file)
@@ -598,7 +598,6 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
 int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy);
 
 int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
-                                  struct cpufreq_frequency_table *table,
                                   unsigned int target_freq,
                                   unsigned int relation,
                                   unsigned int *index);