Browse Source

timer: Remove init_timer() interface

All users of init_timer() have been updated. Remove the ancient interface.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Kees Cook <keescook@chromium.org>
Kees Cook 7 years ago
parent
commit
7eeb6b893b
2 changed files with 3 additions and 10 deletions
  1. 3 7
      Documentation/core-api/local_ops.rst
  2. 0 3
      include/linux/timer.h

+ 3 - 7
Documentation/core-api/local_ops.rst

@@ -177,18 +177,14 @@ Here is a sample module which implements a basic per cpu counter using
                     printk("Read : CPU %d, count %ld\n", cpu,
                     printk("Read : CPU %d, count %ld\n", cpu,
                             local_read(&per_cpu(counters, cpu)));
                             local_read(&per_cpu(counters, cpu)));
             }
             }
-            del_timer(&test_timer);
-            test_timer.expires = jiffies + 1000;
-            add_timer(&test_timer);
+            mod_timer(&test_timer, jiffies + 1000);
     }
     }
 
 
     static int __init test_init(void)
     static int __init test_init(void)
     {
     {
             /* initialize the timer that will increment the counter */
             /* initialize the timer that will increment the counter */
-            init_timer(&test_timer);
-            test_timer.function = do_test_timer;
-            test_timer.expires = jiffies + 1;
-            add_timer(&test_timer);
+            timer_setup(&test_timer, do_test_timer, 0);
+            mod_timer(&test_timer, jiffies + 1);
 
 
             return 0;
             return 0;
     }
     }

+ 0 - 3
include/linux/timer.h

@@ -117,9 +117,6 @@ static inline void init_timer_on_stack_key(struct timer_list *timer,
 	init_timer_on_stack_key((_timer), (_flags), NULL, NULL)
 	init_timer_on_stack_key((_timer), (_flags), NULL, NULL)
 #endif
 #endif
 
 
-#define init_timer(timer)						\
-	__init_timer((timer), 0)
-
 #define __setup_timer(_timer, _fn, _data, _flags)			\
 #define __setup_timer(_timer, _fn, _data, _flags)			\
 	do {								\
 	do {								\
 		__init_timer((_timer), (_flags));			\
 		__init_timer((_timer), (_flags));			\