diff mbox

[V2,15/19] tick-sched: define 'delta' inside 'if' block in update_ts_time_stats()

Message ID 731eed40967a674b1c2cf7f4428cbe195d78c0ca.1398072824.git.viresh.kumar@linaro.org
State New
Headers show

Commit Message

Viresh Kumar April 21, 2014, 9:55 a.m. UTC
'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.kumar@linaro.org>
---
 kernel/time/tick-sched.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox

Patch

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);