[PATCH] kernel/hrtimer.c: use function hrtimer_is_queued

From: Julia Lawall
Date: Mon Apr 06 2009 - 10:58:24 EST


From: Julia Lawall <julia@xxxxxxx>

Use the hrtimer_is_queued function rather than an explicit bit-and for
testing timer->state, as done elsewhere.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@header@
@@

#include <linux/hrtimer.h>

@depends on header@
struct hrtimer *timer;
@@

- (timer->state & HRTIMER_STATE_ENQUEUED)
+ hrtimer_is_queued(timer)
// </smpl>

Signed-off-by: Julia Lawall <julia@xxxxxxx>

---
kernel/hrtimer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/kernel/hrtimer.c b/kernel/hrtimer.c
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -850,7 +850,7 @@ static void __remove_hrtimer(struct hrti
struct hrtimer_clock_base *base,
unsigned long newstate, int reprogram)
{
- if (timer->state & HRTIMER_STATE_ENQUEUED) {
+ if (hrtimer_is_queued(timer)) {
/*
* Remove the timer from the rbtree and replace the
* first entry pointer if necessary.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/