pass: gov: Rename struct pass_cpufreq_policy to pass_freq_policy 45/113945/1
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 9 Feb 2017 10:12:15 +0000 (19:12 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 9 Feb 2017 10:12:15 +0000 (19:12 +0900)
This patch renames 'struct pass_cpufreq_policy' to 'struct pass_freq_policy'
in order to remove the specific h/w dependency from name of structure.
This structure is used for all DVFS resources such as CPU, BUS and GPU.
- struct pass_cpufreq_policy cpufreq -> struct pass_freq_policy freq

Change-Id: I39560cc3f10846cd8f280b60eb8dbf78afb3e19c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/pass/pass-gov-radiation.c
src/pass/pass-gov.c
src/pass/pass-hal.c
src/pass/pass.c
src/pass/pass.h

index 893ecdd1cad177b6f92a16238eb5a050d91f4be0..8ad4673ae0fcab1743ba93e4ec7cc65769f36750 100644 (file)
@@ -172,12 +172,12 @@ int pass_radiation_governor(struct pass_policy *policy)
                return level;
 
        if (up_count * 100 >= num_pass_gov * up_threshold) {
-               level += policy->cpufreq.num_nr_cpus;
+               level += policy->freq.num_nr_cpus;
 
                if (level > policy->max_level)
-                       level -= policy->cpufreq.num_nr_cpus;
+                       level -= policy->freq.num_nr_cpus;
        } else if (down_count * 100 >= num_pass_gov * down_threshold) {
-               level -= policy->cpufreq.num_nr_cpus;
+               level -= policy->freq.num_nr_cpus;
        }
 
        if (right_count * 100 >= num_pass_gov * up_threshold) {
index 7dab679c842816bbd5aa972d7318fc929362d4d1..2edbbed25b0e694f8d435ee5db5b2a49ed91c50e 100644 (file)
@@ -135,7 +135,7 @@ static void pass_hotplug_set_online(struct pass_policy *policy,
        if (online > hotplug->max_online)
                online = hotplug->max_online;
 
-       for (i = 0 ; i < policy->cpufreq.num_nr_cpus; i++) {
+       for (i = 0 ; i < policy->freq.num_nr_cpus; i++) {
                if (i < online) {
                        pass_set_online_state(pass_res, hotplug->sequence[i],
                                                PASS_CPU_UP);
@@ -168,7 +168,7 @@ static void pass_hotplug_stop(struct pass_policy *policy)
                return;
 
        policy->hotplug->online = table[level].limit_min_cpu;
-       policy->hotplug->max_online = policy->cpufreq.num_nr_cpus;
+       policy->hotplug->max_online = policy->freq.num_nr_cpus;
 }
 
 static int pass_hotplug_dummy_governor(struct pass_policy *policy)
@@ -334,7 +334,7 @@ static void pass_calculate_busy_cpu(struct pass_policy *policy)
                sum_runnable_load = 0;
 
                /* Calculate the number of busy cpu */
-               for (j = 0; j < policy->cpufreq.num_nr_cpus; j++) {
+               for (j = 0; j < policy->freq.num_nr_cpus; j++) {
                        load = stats[i].load[j];
                        sum_load += stats[i].load[j];
                        sum_runnable_load += stats[i].runnable_load[j];
@@ -343,7 +343,7 @@ static void pass_calculate_busy_cpu(struct pass_policy *policy)
 
                        cpu_threshold =
                                (unsigned int)(cur_freq * load)
-                                               / policy->cpufreq.max_freq;
+                                               / policy->freq.max_freq;
                        if (load == 100
                                || cpu_threshold >= policy->pass_cpu_threshold)
                                busy_cpu++;
@@ -614,11 +614,11 @@ static int __pass_governor_update(struct pass_policy *policy,
 }
 
 /*
- * pass_governor_change_level_scope - Change the scope of cpufreq scaling
+ * pass_governor_change_level_scope - Change the scope of frequency scaling
  *
  * @policy: the instance of struct pass_policy
- * @min_level: the minimum level of cpufreq scaling
- * @max_level: the maximum level of cpufreq scaling
+ * @min_level: the minimum level of frequency scaling
+ * @max_level: the maximum level of frequency scaling
  */
 int pass_governor_change_level_scope(struct pass_policy *policy,
                                            int min_level, int max_level)
@@ -636,7 +636,7 @@ int pass_governor_change_level_scope(struct pass_policy *policy,
                && max_level == policy->max_level)
                return 0;
 
-       /* Change minimum/maximum level of cpufreq scaling */
+       /* Change minimum/maximum level of frequency scaling */
        policy->min_level = min_level;
        policy->max_level = max_level;
 
index 220b4546528a123c743a079b00b5fbbd192c298b..ceb65f3c5e3f8ce740bcba3516c0013e9a60de22 100644 (file)
@@ -502,7 +502,7 @@ int pass_get_cpu_stats(struct pass_policy *policy)
                if (ret < 0)
                        return -EIO;
 
-               for (j = 0; j < policy->cpufreq.num_nr_cpus; j++) {
+               for (j = 0; j < policy->freq.num_nr_cpus; j++) {
                        ret = fscanf(fp_stats, "%d", &stats[i].load[j]);
                        if (ret < 0)
                                return -EIO;
index 726bc649b03eb1e218c8b7102e12e5e3997bb001..6ebb7300a1f9527e4f4411f6ca6d9ef8020a6ec2 100644 (file)
@@ -159,8 +159,8 @@ static int pass_resource_init(struct pass_policy *policy)
                if (max_cpu < policy->pass_table[i].limit_min_cpu)
                        max_cpu = policy->pass_table[i].limit_min_cpu;
        }
-       policy->cpufreq.max_freq = max_freq;
-       policy->cpufreq.num_nr_cpus = max_cpu;
+       policy->freq.max_freq = max_freq;
+       policy->freq.num_nr_cpus = max_cpu;
 
        /* Allocate memory according to the number of data and cpu */
        policy->pass_cpu_stats = calloc(policy->num_pass_cpu_stats,
@@ -168,11 +168,11 @@ static int pass_resource_init(struct pass_policy *policy)
 
        for (i = 0; i < policy->num_pass_cpu_stats; i++) {
                policy->pass_cpu_stats[i].load =
-                       calloc(policy->cpufreq.num_nr_cpus, sizeof(unsigned int));
+                       calloc(policy->freq.num_nr_cpus, sizeof(unsigned int));
                policy->pass_cpu_stats[i].nr_running =
-                       calloc(policy->cpufreq.num_nr_cpus, sizeof(unsigned int));
+                       calloc(policy->freq.num_nr_cpus, sizeof(unsigned int));
                policy->pass_cpu_stats[i].runnable_load =
-                       calloc(policy->cpufreq.num_nr_cpus, sizeof(unsigned int));
+                       calloc(policy->freq.num_nr_cpus, sizeof(unsigned int));
        }
 
        /* Get the instance of PASS governor */
@@ -188,9 +188,9 @@ static int pass_resource_init(struct pass_policy *policy)
        if (!policy->hotplug) {
                _E("cannot get the instance of PASS hotplug");
        } else {
-               policy->hotplug->sequence = calloc(policy->cpufreq.num_nr_cpus,
+               policy->hotplug->sequence = calloc(policy->freq.num_nr_cpus,
                                                sizeof(int));
-               for (i = 0; i < policy->cpufreq.num_nr_cpus; i++)
+               for (i = 0; i < policy->freq.num_nr_cpus; i++)
                        policy->hotplug->sequence[i] = i + pass_res->cdata.cpu;
        }
 
index 427dc0ecf949eeca0065889ce3a9a70a6dccb0f0..fdb18b7fd985c44700799e5b60f96adeb58f8eed 100644 (file)
@@ -171,7 +171,7 @@ struct pass_hotplug {
 };
 
 
-struct pass_cpufreq_policy {
+struct pass_freq_policy {
        unsigned int max_freq;
        unsigned int num_nr_cpus;
        unsigned int sampling_rate;
@@ -220,7 +220,7 @@ struct pass_policy {
 
        int64_t last_time;
 
-       struct pass_cpufreq_policy cpufreq;
+       struct pass_freq_policy freq;
        struct pass_scenario_policy scenario;
 
        struct pass_table *pass_table;