cpufreq: sprd: Remove build warnings 94/159094/2
authorWook Song <wook16.song@samsung.com>
Tue, 7 Nov 2017 02:49:04 +0000 (11:49 +0900)
committerWook Song <wook16.song@samsung.com>
Tue, 7 Nov 2017 06:25:55 +0000 (15:25 +0900)
This patch removes build warnings introduced by unused variables, unused
functions, and -Wincompatible-pointer-types.

Change-Id: Icfc07589b52bb4d51af7e27d87e97ace1568dcd4
Signed-off-by: Wook Song <wook16.song@samsung.com>
drivers/cpufreq/cpufreq_sprdemand.c

index 6d3a883..c2b3242 100644 (file)
@@ -165,8 +165,6 @@ int cpu_core_thermal_limit(int cluster, int max_core)
 {
 
        struct sd_dbs_tuners *sd_tuners = g_sd_tuners;
-       int cpus = 0;
-       int i = 0;
 
        if (sd_tuners->cpu_num_limit <=  max_core) {
                sd_tuners->cpu_num_limit = max_core;
@@ -460,7 +458,9 @@ unsigned int a_sub_windowsize[8][6] =
        {0,1,1,2,3,3}
 };
 
-static int cpu_evaluate_score(int cpu, struct sd_dbs_tuners *sd_tunners , unsigned int load)
+static __maybe_unused
+int cpu_evaluate_score(int cpu, struct sd_dbs_tuners *sd_tunners,
+               unsigned int load)
 {
        int score = 0;
        static int rate[4] = {1};
@@ -546,7 +546,9 @@ static int sd_adjust_window(struct sd_dbs_tuners *sd_tunners , unsigned int load
        return cur_window_size;
 }
 
-static unsigned int sd_unplug_avg_load(int cpu, struct sd_dbs_tuners *sd_tunners , unsigned int load)
+static __maybe_unused
+unsigned int sd_unplug_avg_load(int cpu, struct sd_dbs_tuners *sd_tunners,
+               unsigned int load)
 {
        int sum_idx_lo = 0;
        unsigned int sum_idx_hi = 0;
@@ -640,7 +642,9 @@ static unsigned int sd_unplug_avg_load(int cpu, struct sd_dbs_tuners *sd_tunners
 }
 
 
-static unsigned int sd_unplug_avg_load1(int cpu, struct sd_dbs_tuners *sd_tunners , unsigned int load)
+static __maybe_unused
+unsigned int sd_unplug_avg_load1(int cpu, struct sd_dbs_tuners *sd_tunners,
+               unsigned int load)
 {
        int avg_load = 0;
        int cur_window_pos = 0;
@@ -750,12 +754,14 @@ static unsigned int sd_unplug_avg_load1(int cpu, struct sd_dbs_tuners *sd_tunner
 
 }
 
-static unsigned int sd_unplug_avg_load11(int cpu, struct sd_dbs_tuners *sd_tunners , unsigned int load)
+static __maybe_unused
+unsigned int sd_unplug_avg_load11(int cpu, struct sd_dbs_tuners *sd_tunners,
+               unsigned int load)
 {
        int avg_load = 0;
        int cur_window_pos = 0;
        int cur_window_pos_tail = 0;
-       int idx = 0;
+
        /*
        initialize the window size for the first time
        cur_window_cnt[cpu] will be cleared when the core is unpluged
@@ -1540,7 +1546,7 @@ static ssize_t store_cpu_hotplug_disable(struct dbs_data *dbs_data, const char *
                size_t count)
 {
        struct sd_dbs_tuners *sd_tuners = dbs_data->tuners;
-       unsigned int input, cpu;
+       unsigned int input;
        int ret;
        ret = sscanf(buf, "%u", &input);
 
@@ -1788,7 +1794,7 @@ static int sd_init(struct dbs_data *dbs_data)
 {
        struct sd_dbs_tuners *tuners;
        u64 idle_time;
-       int cpu, i;
+       int cpu;
 
        tuners = kzalloc(sizeof(struct sd_dbs_tuners), GFP_KERNEL);
 
@@ -1861,15 +1867,6 @@ static int sd_init(struct dbs_data *dbs_data)
        INIT_WORK(&plugin_all_work, sprd_plugin_all_cpu);
        INIT_WORK(&unplug_all_work, sprd_unplug_all_cpu);
 
-#if 0
-       for_each_possible_cpu(i) {
-               puwi = &per_cpu(uwi, i);
-               puwi->cpuid = i;
-               puwi->dbs_data = dbs_data;
-               INIT_DELAYED_WORK(&puwi->unplug_work, sprd_unplug_one_cpu);
-       }
-#endif
-
        return 0;
 }
 
@@ -2023,9 +2020,6 @@ static void dbs_refresh_callback(struct work_struct *work)
 static void dbs_input_event(struct input_handle *handle, unsigned int type,
                unsigned int code, int value)
 {
-       int i;
-       bool ret;
-
        if (time_before(jiffies, boot_done))
                return;
 
@@ -2099,7 +2093,7 @@ static const struct input_device_id dbs_ids[] = {
        { },
 };
 
-void sprd_tb_thread(void)
+int sprd_tb_thread(void *data)
 {
        while (1) {
                down(&tb_sem);
@@ -2107,6 +2101,8 @@ void sprd_tb_thread(void)
                if (num_online_cpus() < 3)
                        schedule_delayed_work_on(0, &plugin_work, 0);
        }
+
+       return 0;
 }
 
 struct input_handler dbs_input_handler = {
@@ -2121,7 +2117,6 @@ struct input_handler dbs_input_handler = {
 static struct task_struct *ksprd_tb;
 static int __init cpufreq_gov_dbs_init(void)
 {
-       int i = 0;
        boot_done = jiffies + GOVERNOR_BOOT_TIME;
 #if !(defined(CONFIG_MACH_SP9838AEA_5MOD) || defined(CONFIG_MACH_SP9838AEA_4CORE) || defined(CONFIG_MACH_SP9838AEA_8CORE_LIGHT_SLEEP) || defined(CONFIG_MACH_SS_SHARKLT8))
        register_pm_notifier(&sprdemand_gov_pm_notifier);