diff mbox

[V2,32/36] hrtimer: make switch_hrtimer_base() return void

Message ID 7cdbe065e7f05587461b21583ca76b63cee5f16e.1396592516.git.viresh.kumar@linaro.org
State New
Headers show

Commit Message

Viresh Kumar April 4, 2014, 6:36 a.m. UTC
switch_hrtimer_base() always sets timer->base to the right base and so the
caller can obtain it easily. So, this routine doesn't need to return anything.

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

Patch

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index fcbabcf..e581bba 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -211,8 +211,7 @@  hrtimer_check_target(struct hrtimer *timer, struct hrtimer_clock_base *new_base)
 /*
  * Switch the timer base to the current CPU when possible.
  */
-static inline struct hrtimer_clock_base *
-switch_hrtimer_base(struct hrtimer *timer, int pinned)
+static inline void switch_hrtimer_base(struct hrtimer *timer, int pinned)
 {
 	struct hrtimer_clock_base *new_base, *base = timer->base;
 	struct hrtimer_cpu_base *new_cpu_base;
@@ -224,7 +223,7 @@  again:
 	new_base = &new_cpu_base->clock_base[base->index];
 
 	if (base == new_base)
-		return base;
+		return;
 
 	/*
 	 * We are trying to move timer to new_base. However we can't change
@@ -235,7 +234,7 @@  again:
 	 * timer is enqueued.
 	 */
 	if (unlikely(hrtimer_callback_running(timer)))
-		return base;
+		return;
 
 	/* See the comment in lock_timer_base() */
 	timer->base = NULL;
@@ -251,7 +250,6 @@  again:
 	}
 
 	timer->base = new_base;
-	return new_base;
 }
 
 #else /* CONFIG_SMP */
@@ -266,7 +264,7 @@  lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags)
 	return base;
 }
 
-# define switch_hrtimer_base(t, p)	(t->base)
+static inline void switch_hrtimer_base(struct hrtimer *timer, int pinned) {}
 
 #endif	/* !CONFIG_SMP */
 
@@ -949,7 +947,7 @@  int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
 		unsigned long delta_ns, const enum hrtimer_mode mode,
 		int wakeup)
 {
-	struct hrtimer_clock_base *base, *new_base;
+	struct hrtimer_clock_base *base;
 	unsigned long flags;
 	int ret, leftmost;
 
@@ -975,7 +973,7 @@  int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
 	hrtimer_set_expires_range_ns(timer, tim, delta_ns);
 
 	/* Switch the timer base, if necessary: */
-	new_base = switch_hrtimer_base(timer, mode & HRTIMER_MODE_PINNED);
+	switch_hrtimer_base(timer, mode & HRTIMER_MODE_PINNED);
 
 	timer_stats_hrtimer_set_start_info(timer);
 
@@ -987,7 +985,7 @@  int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
 	 *
 	 * XXX send_remote_softirq() ?
 	 */
-	if (leftmost && base_on_this_cpu(new_base)
+	if (leftmost && base_on_this_cpu(timer->base)
 		&& hrtimer_enqueue_reprogram(timer)) {
 		if (wakeup) {
 			/*