[PATCH] Minor timer.c cleanup test3-pre2

From: Rusty Russell (rusty@linuxcare.com.au)
Date: Tue Jul 04 2000 - 01:51:37 EST


timer_enter() and timer_exit() are no longer for public consumption.

Should probably get rid of `timer_is_running()' as well, as it is
semantically void without the timer lock.

Later,
Rusty.

diff -urN -X /tmp/filePJPMTc --minimal linux-2.4.0-test3-2/include/linux/timer.h working-2.4.0-test3-2/include/linux/timer.h
--- linux-2.4.0-test3-2/include/linux/timer.h Tue Jul 4 16:33:26 2000
+++ working-2.4.0-test3-2/include/linux/timer.h Tue Jul 4 16:33:58 2000
@@ -82,14 +82,10 @@
 }
 
 #ifdef CONFIG_SMP
-#define timer_enter(t) do { (t)->sequence = timer_sequence; mb(); } while (0)
-#define timer_exit() do { timer_sequence++; } while (0)
 #define timer_is_running(t) ((t)->sequence == timer_sequence)
 #define timer_synchronize(t) while (timer_is_running(t)) barrier()
 extern int del_timer_sync(struct timer_list * timer);
 #else
-#define timer_enter(t) do { } while (0)
-#define timer_exit() do { } while (0)
 #define timer_is_running(t) (0)
 #define timer_synchronize(t) do { (void)(t); barrier(); } while(0)
 #define del_timer_sync(t) del_timer(t)
diff -urN -X /tmp/filePJPMTc --minimal linux-2.4.0-test3-2/kernel/timer.c working-2.4.0-test3-2/kernel/timer.c
--- linux-2.4.0-test3-2/kernel/timer.c Tue Jul 4 16:33:27 2000
+++ working-2.4.0-test3-2/kernel/timer.c Tue Jul 4 16:45:16 2000
@@ -298,11 +298,11 @@
 
                         detach_timer(timer);
                         timer->list.next = timer->list.prev = NULL;
- timer_enter(timer);
+ timer->sequence = timer_sequence;
                         spin_unlock_irq(&timerlist_lock);
                         fn(data);
+ timer_sequence++;
                         spin_lock_irq(&timerlist_lock);
- timer_exit();
                         goto repeat;
                 }
                 ++timer_jiffies;

--
Hacking time.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:15 EST