staging: speakup: Replace del_timer with del_timer_sync
PATCH 1/1 staging: speakup: Replace del_timer with del_timer_sync
Use del_timer_sync to ensure timer is stopped on all CPUs before the driver exists.
The Coccinelle semantic patch used to make this change is as follows:
// <smpl>
@r@
declarer name module_exit;
identifier ex;
@@
module_exit(ex);
@@
identifier r.ex;
@@
ex(...) {
<...
- del_timer
+ del_timer_sync
(...)
...>
}
// </smpl>
--- drivers/staging/speakup/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/main.c +1 -1
@@ -2265,7 +2265,7 @@ static void __exit speakup_exit(void)unregister_vt_notifier (&vt_notifier_block);speakup_unregister_devsynth ();speakup_cancel_paste (); -del_timer (&cursor_timer); +del_timer_sync (&cursor_timer);kthread_stop (speakup_task); speakup_task =NULL ;mutex_lock (&spk_mutex);
Signature · 1 line
1.9.1
Quoted 2 lines · Amitoj Kaur Chawla
Use
del_timer_syncto ensure timer is stopped on all CPUs before the driver exists.
I think that you need to give more information about the need for this. When would the change not be needed, for example?
julia
Quoted 52 lines
The Coccinelle semantic patch used to make this change is as follows:
// <smpl>
@r@
declarer namemodule_exit;
identifier ex;
@@
module_exit(ex);@@
identifier r.ex;
@@ex(...) {
<...
-del_timer
+del_timer_sync(...)...>
}
// </smpl>Signed-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/speakup/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/speakup/main.c +1
-2@@ -2265,7 +2265,7 @@ static void __exit speakup_exit(void)unregister_vt_notifier (&vt_notifier_block);speakup_unregister_devsynth ();speakup_cancel_paste (); -del_timer (&cursor_timer); +del_timer_sync (&cursor_timer);kthread_stop (speakup_task); speakup_task =NULL ;mutex_lock (&spk_mutex); --1.9.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160305123517.GA11630%40amitoj-Inspiron-3542.
For more options, visit https://groups.google.com/d/optout.
Quoted 10 lines · Julia Lawall
Quoted 2 lines · Amitoj Kaur Chawla
Use
del_timer_syncto ensure timer is stopped on all CPUs before the driver exists.I think that you need to give more information about the need for this. When would the change not be needed, for example?
julia
Mention the fact that the timer is not called from a interrupt context so it is safe to switch to del_timer_sync?
Amitoj