aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-12 02:13:49 -0400
committerKees Cook <keescook@chromium.org>2017-11-21 18:57:09 -0500
commit7eeb6b893bd28c68b6d664de1d3120e49b855cdb (patch)
tree47dfd9096c2f8018fd2bf3ef6ad4cb35378ec69e
parent86cb30ec07cdc78ad94d94bb3756c7c2d46968b9 (diff)
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>
-rw-r--r--Documentation/core-api/local_ops.rst10
-rw-r--r--include/linux/timer.h3
2 files changed, 3 insertions, 10 deletions
diff --git a/Documentation/core-api/local_ops.rst b/Documentation/core-api/local_ops.rst
index 1062ddba62c7..2ac3f9f29845 100644
--- a/Documentation/core-api/local_ops.rst
+++ b/Documentation/core-api/local_ops.rst
@@ -177,18 +177,14 @@ Here is a sample module which implements a basic per cpu counter using
177 printk("Read : CPU %d, count %ld\n", cpu, 177 printk("Read : CPU %d, count %ld\n", cpu,
178 local_read(&per_cpu(counters, cpu))); 178 local_read(&per_cpu(counters, cpu)));
179 } 179 }
180 del_timer(&test_timer); 180 mod_timer(&test_timer, jiffies + 1000);
181 test_timer.expires = jiffies + 1000;
182 add_timer(&test_timer);
183 } 181 }
184 182
185 static int __init test_init(void) 183 static int __init test_init(void)
186 { 184 {
187 /* initialize the timer that will increment the counter */ 185 /* initialize the timer that will increment the counter */
188 init_timer(&test_timer); 186 timer_setup(&test_timer, do_test_timer, 0);
189 test_timer.function = do_test_timer; 187 mod_timer(&test_timer, jiffies + 1);
190 test_timer.expires = jiffies + 1;
191 add_timer(&test_timer);
192 188
193 return 0; 189 return 0;
194 } 190 }
diff --git a/include/linux/timer.h b/include/linux/timer.h
index bf781acfc6d8..a58097ea7cfc 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -117,9 +117,6 @@ static inline void init_timer_on_stack_key(struct timer_list *timer,
117 init_timer_on_stack_key((_timer), (_flags), NULL, NULL) 117 init_timer_on_stack_key((_timer), (_flags), NULL, NULL)
118#endif 118#endif
119 119
120#define init_timer(timer) \
121 __init_timer((timer), 0)
122
123#define __setup_timer(_timer, _fn, _data, _flags) \ 120#define __setup_timer(_timer, _fn, _data, _flags) \
124 do { \ 121 do { \
125 __init_timer((_timer), (_flags)); \ 122 __init_timer((_timer), (_flags)); \