OSDN Git Service

sched: Initialize variables
authorOlav Haugan <ohaugan@codeaurora.org>
Sat, 14 Jan 2017 01:04:36 +0000 (17:04 -0800)
committerOlav Haugan <ohaugan@codeaurora.org>
Sat, 14 Jan 2017 01:06:01 +0000 (17:06 -0800)
Initialize variable at definition to avoid compiler warning when
compiling with CONFIG_OPTIMIZE_FOR_SIZE=n.

Change-Id: Ibd201877b2274c70ced9d7240d0e527bc77402f3
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
kernel/sched/core.c
kernel/sched/hmp.c

index b70a760..76cbd55 100644 (file)
@@ -5859,7 +5859,7 @@ int sched_isolate_cpu(int cpu)
        struct rq *rq = cpu_rq(cpu);
        cpumask_t avail_cpus;
        int ret_code = 0;
-       u64 start_time;
+       u64 start_time = 0;
 
        if (trace_sched_isolate_enabled())
                start_time = sched_clock();
@@ -5929,7 +5929,7 @@ int sched_unisolate_cpu_unlocked(int cpu)
 {
        int ret_code = 0;
        struct rq *rq = cpu_rq(cpu);
-       u64 start_time;
+       u64 start_time = 0;
 
        if (trace_sched_isolate_enabled())
                start_time = sched_clock();
index 180e2fc..e637d27 100644 (file)
@@ -2274,7 +2274,7 @@ static void update_cpu_busy_time(struct task_struct *p, struct rq *rq,
        bool new_task;
        struct related_thread_group *grp;
        int cpu = rq->cpu;
-       u32 old_curr_window;
+       u32 old_curr_window = p->ravg.curr_window;
 
        new_window = mark_start < window_start;
        if (new_window) {
@@ -2335,8 +2335,6 @@ static void update_cpu_busy_time(struct task_struct *p, struct rq *rq,
         * task or exiting tasks.
         */
        if (!is_idle_task(p) && !exiting_task(p)) {
-               old_curr_window = p->ravg.curr_window;
-
                if (new_window)
                        rollover_task_window(p, full_window);
        }