lkml.org 
[lkml]   [2014]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 12/16] hrtimer: rewrite switch_hrtimer_base() to remove extra indentation level
Date
Complete bottom part of switch_hrtimer_base() is part of a 'if' block and so all
code present in that block has extra indentation level before it. Rewrite it to
remove this extra indentation level.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
kernel/hrtimer.c | 48 ++++++++++++++++++++++++------------------------
1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 04f8e44..30efa1c 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -203,33 +203,33 @@ again:
new_cpu_base = &per_cpu(hrtimer_bases, cpu);
new_base = &new_cpu_base->clock_base[base->index];

- if (base != new_base) {
- /*
- * We are trying to move timer to new_base.
- * However we can't change timer's base while it is running,
- * so we keep it on the same CPU. No hassle vs. reprogramming
- * the event source in the high resolution case. The softirq
- * code will take care of this when the timer function has
- * completed. There is no conflict as we hold the lock until
- * the timer is enqueued.
- */
- if (unlikely(hrtimer_callback_running(timer)))
- return;
+ if (base == new_base)
+ return;

- /* See the comment in lock_timer_base() */
- timer->base = NULL;
- raw_spin_unlock(&base->cpu_base->lock);
- raw_spin_lock(&new_base->cpu_base->lock);
+ /*
+ * We are trying to move timer to new_base. However we can't change
+ * timer's base while it is running, so we keep it on the same CPU. No
+ * hassle vs. reprogramming the event source in the high resolution
+ * case. The softirq code will take care of this when the timer function
+ * has completed. There is no conflict as we hold the lock until the
+ * timer is enqueued.
+ */
+ if (unlikely(hrtimer_callback_running(timer)))
+ return;

- if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) {
- cpu = this_cpu;
- raw_spin_unlock(&new_base->cpu_base->lock);
- raw_spin_lock(&base->cpu_base->lock);
- timer->base = base;
- goto again;
- }
- timer->base = new_base;
+ /* See the comment in lock_timer_base() */
+ timer->base = NULL;
+ raw_spin_unlock(&base->cpu_base->lock);
+ raw_spin_lock(&new_base->cpu_base->lock);
+
+ if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) {
+ cpu = this_cpu;
+ raw_spin_unlock(&new_base->cpu_base->lock);
+ raw_spin_lock(&base->cpu_base->lock);
+ timer->base = base;
+ goto again;
}
+ timer->base = new_base;
}

#else /* CONFIG_SMP */
--
1.7.12.rc2.18.g61b472e


\
 
 \ /
  Last update: 2014-03-28 14:01    [W:0.138 / U:2.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site