lkml.org 
[lkml]   [2014]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V2 17/36] hrtimer: don't check if timer is queued in __remove_hrtimer()
Date
__remove_hrtimer() is called from three locations: remove_hrtimer(),
__run_hrtimer() and migrate_hrtimer_list(). And all these guarantee that timer
was queued earlier. And so there is no need to check if the timer is queued or
not in __remove_hrtimer().

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

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 1a1fdc0..58b5e3f 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -886,8 +886,6 @@ static void __remove_hrtimer(struct hrtimer *timer,
unsigned long newstate, int reprogram)
{
struct timerqueue_node *next_timer;
- if (!(timer->state & HRTIMER_STATE_ENQUEUED))
- goto out;

next_timer = timerqueue_getnext(&base->active);
timerqueue_del(&base->active, &timer->node);
@@ -903,10 +901,9 @@ static void __remove_hrtimer(struct hrtimer *timer,
hrtimer_force_reprogram(base->cpu_base, 1);
}
#endif
+ timer->state = newstate;
if (!timerqueue_getnext(&base->active))
base->cpu_base->active_bases &= ~(1 << base->index);
-out:
- timer->state = newstate;
}

/*
--
1.7.12.rc2.18.g61b472e


\
 
 \ /
  Last update: 2014-04-04 09:21    [W:0.303 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site