'delta' is used only inside the 'if' block and must be accessible within that.
So, move its definition inside the 'if' block.

Signed-off-by: Viresh Kumar <viresh.ku...@linaro.org>
---
 kernel/time/tick-sched.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index c3aed50..8e75c13 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -412,10 +412,9 @@ static void
 update_ts_time_stats(int cpu, struct tick_sched *ts, ktime_t now,
                     u64 *last_update_time)
 {
-       ktime_t delta;
-
        if (ts->idle_active) {
-               delta = ktime_sub(now, ts->idle_entrytime);
+               ktime_t delta = ktime_sub(now, ts->idle_entrytime);
+
                if (nr_iowait_cpu(cpu) > 0)
                        ts->iowait_sleeptime = ktime_add(ts->iowait_sleeptime,
                                                         delta);
-- 
1.7.12.rc2.18.g61b472e

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to