sched/power: cleanup warnings
authorLukasz Luba <l.luba@partner.samsung.com>
Wed, 7 Nov 2018 20:51:07 +0000 (21:51 +0100)
committerLukasz Luba <l.luba@partner.samsung.com>
Fri, 17 May 2019 07:15:45 +0000 (09:15 +0200)
It will be squashed

Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
kernel/sched/power.c
kernel/sched/power.h

index d2ba44befaae7db19911e152d18dce5f28beba15..327f49a670d21d2f00d5d065f03803bd3660c06f 100644 (file)
@@ -122,12 +122,6 @@ int sched_power_cpu_reinit_weight(int cpu, int weight)
 }
 EXPORT_SYMBOL_GPL(sched_power_cpu_reinit_weight);
 
-static int vidle_setup(int cpu, int rate, int period)
-{
-
-       return 0;
-}
-
 
 //////////////////////////////////////////////////////////////
 
@@ -160,8 +154,6 @@ static void sched_power_idle_stop(struct cpu_power *cpower)
 static int sched_power_idle_play(struct cpu_power *cpower, unsigned int period,
                                  unsigned int idle)
 {
-       unsigned int run;
-
        if (period <= idle)
                return -EINVAL;
 
@@ -187,13 +179,13 @@ static int
 sched_power_reweight_cluster(int cpu, struct cpumask *cpus, unsigned int capacity,
                             unsigned int period, int flags)
 {
-       int ret, i;
-       struct cpu_power *cpower = NULL;
-       int opp_curr_state, opp_curr_cost;
-       int opp_next_state, opp_next_cost;
-       u64 cluster_udget;
-       u64 total_weight = 0;
-
+       /* int ret, i; */
+       /* struct cpu_power *cpower = NULL; */
+       /* int opp_curr_state, opp_curr_cost; */
+       /* int opp_next_state, opp_next_cost; */
+       /* u64 cluster_udget; */
+       /* u64 total_weight = 0; */
+        /*  */
        /* opp_next_state = get_opp_for_capacity(cpu, capacity); */
        /* opp_next_cost = get_opp_cost(cpu, opp_next_state); */
         /*  */
@@ -279,8 +271,6 @@ static void
 sched_power_update_cpu_weight(struct cpu_power *cpower, int cpu, int weight,
                              int flags, int time)
 {
-       struct sched_power *sp;
-
        raw_spin_lock(&cpower->update_lock);
        cpower->req.weight = weight;
        cpower->req.cpu = cpu;
@@ -400,7 +390,7 @@ static int sched_power_idle_init(struct sched_power *sp)
 {
        struct idle_inject_device *ii_dev;
        struct cpumask *cpus;
-       int i, last_cpu;
+       int i, last_cpu = 0;
        struct cpu_power *cpower;
 
 
@@ -413,7 +403,6 @@ static int sched_power_idle_init(struct sched_power *sp)
 
                ii_dev = idle_inject_register(cpus);
                if (IS_ERR_OR_NULL(ii_dev)) {
-                       last_cpu;
                        goto cleanup;
                }
 
@@ -423,6 +412,7 @@ static int sched_power_idle_init(struct sched_power *sp)
                raw_spin_unlock(&cpower->update_lock);
 
                cpumask_clear_cpu(i, cpus);
+               last_cpu = i;
        }
 
        kfree(cpus);
@@ -446,8 +436,7 @@ cleanup:
 
 static void sched_power_idle_unregister(struct sched_power *sp)
 {
-       struct idle_inject_device *ii_dev;
-       int i, last_cpu;
+       int i;
        struct cpu_power *cpower;
 
        for_each_possible_cpu(i) {
@@ -539,7 +528,7 @@ static u64 calc_power_budget(struct thermal_zone_device *tz, int desire_temp)
 
        power_budget = temp_diff;
 
-       power_budget = max(0, power_budget);
+       power_budget = max(0LL, power_budget);
 
        return power_budget;
 }
@@ -578,10 +567,11 @@ static int throttle_single_cdev(struct _thermal_zone *zone)
        return 0;
 }
 
+
 static int sched_power_gov_throttle(struct thermal_zone_device *tz, int trip)
 {
-       struct thermal_cooling_device *cdev;
-       struct thermal_instance *inst;
+       struct thermal_cooling_device *cdev = NULL;
+       struct thermal_instance *inst = NULL;
        u32 dev_power;
        struct _thermal_zone *zone;
        int ret;
@@ -658,7 +648,7 @@ static int sched_power_gov_bind(struct thermal_zone_device *tz)
 {
        struct thermal_instance *inst;
        struct _thermal_zone *zone;
-       struct _cooling_dev *cooling, *prev_cooling;
+       struct _cooling_dev *cooling, *prev_cooling = NULL;
        struct _cooling_instance *_inst, *tmp;
        struct thermal_cooling_device *cdev;
        int i = 0;
@@ -735,12 +725,14 @@ handle_cooling_instance:
        return 0;
 
 cleanup:
-       list_for_each_entry_reverse(cooling, &prev_cooling->node, node) {
-               if (i-- == 0)
-                       break;
-               list_del(&prev_cooling->node);
-               cleanup_percpu_cooling_dev(prev_cooling);
-               prev_cooling = cooling;
+       if (prev_cooling) {
+               list_for_each_entry_reverse(cooling, &prev_cooling->node, node) {
+                       if (i-- == 0)
+                               break;
+                       list_del(&prev_cooling->node);
+                       cleanup_percpu_cooling_dev(prev_cooling);
+                       prev_cooling = cooling;
+               }
        }
        mutex_unlock(&cdev_list_lock);
 
index da969b9bc30fb1993d4f1466a16609437a661a69..7fafaa9f6609f3d6db7977179afe939d05693c79 100644 (file)
@@ -36,7 +36,7 @@ struct power_request {
        unsigned int weight;
        int cpu;
        u64 time;
-       int flags
+       int flags;
 };
 
 struct _cooling_dev;