The timer related functions do not have a strict timer_ prefixed namespace which is really annoying. Rename del_timer() to timer_delete() and provide del_timer() as a wrapper. Document that del_timer() is not for new code.
Unified · Split
| @@ -169,7 +169,6 @@ static inline int timer_pending(const struct timer_list * timer) · 168 unmodified lines | ||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | extern void add_timer_on(struct timer_list *timer, int cpu); |
| 172 | −extern int del_timer(struct timer_list * timer); | |
| 173 | 172 | extern int mod_timer(struct timer_list *timer, unsigned long expires); |
| 174 | 173 | extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); |
| 175 | 174 | extern int timer_reduce(struct timer_list *timer, unsigned long expires); |
| @@ -184,6 +183,7 @@ extern void add_timer(struct timer_list *timer); · 8 unmodified lines | ||
| 184 | 183 | |
| 185 | 184 | extern int try_to_del_timer_sync(struct timer_list *timer); |
| 186 | 185 | extern int timer_delete_sync(struct timer_list *timer); |
| 186 | +extern int timer_delete(struct timer_list *timer); | |
| 187 | 187 | |
| 188 | 188 | /** |
| 189 | 189 | * del_timer_sync - Delete a pending timer and wait for a running callback |
| @@ -198,6 +198,19 @@ static inline int del_timer_sync(struct timer_list *timer) · 8 unmodified lines | ||
| 198 | 198 | return timer_delete_sync(timer); |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | +/** | |
| 202 | + * del_timer - Delete a pending timer | |
| 203 | + * @timer: The timer to be deleted | |
| 204 | + * | |
| 205 | + * See timer_delete() for detailed explanation. | |
| 206 | + * | |
| 207 | + * Do not use in new code. Use timer_delete() instead. | |
| 208 | + */ | |
| 209 | +static inline int del_timer(struct timer_list *timer) | |
| 210 | +{ | |
| 211 | + return timer_delete(timer); | |
| 212 | +} | |
| 213 | + | |
| 201 | 214 | extern void init_timers(void); |
| 202 | 215 | struct hrtimer; |
| 203 | 216 | extern enum hrtimer_restart it_real_fn(struct hrtimer *); |
| @@ -1257,7 +1257,7 @@ void add_timer_on(struct timer_list *timer, int cpu) · 1256 unmodified lines | ||
| 1257 | 1257 | EXPORT_SYMBOL_GPL(add_timer_on); |
| 1258 | 1258 | |
| 1259 | 1259 | /** |
| 1260 | − * del_timer - Deactivate a timer. | |
| 1260 | + * timer_delete - Deactivate a timer | |
| 1261 | 1261 | * @timer: The timer to be deactivated |
| 1262 | 1262 | * |
| 1263 | 1263 | * The function only deactivates a pending timer, but contrary to |
| @@ -1270,7 +1270,7 @@ EXPORT_SYMBOL_GPL(add_timer_on); · 6 unmodified lines | ||
| 1270 | 1270 | * * %0 - The timer was not pending |
| 1271 | 1271 | * * %1 - The timer was pending and deactivated |
| 1272 | 1272 | */ |
| 1273 | −int del_timer(struct timer_list *timer) | |
| 1273 | +int timer_delete(struct timer_list *timer) | |
| 1274 | 1274 | { |
| 1275 | 1275 | struct timer_base *base; |
| 1276 | 1276 | unsigned long flags; |
| @@ -1286,7 +1286,7 @@ int del_timer(struct timer_list *timer) · 9 unmodified lines | ||
| 1286 | 1286 | |
| 1287 | 1287 | return ret; |
| 1288 | 1288 | } |
| 1289 | −EXPORT_SYMBOL(del_timer); | |
| 1289 | +EXPORT_SYMBOL(timer_delete); | |
| 1290 | 1290 | |
| 1291 | 1291 | /** |
| 1292 | 1292 | * try_to_del_timer_sync - Try to deactivate a timer |