-
Notifications
You must be signed in to change notification settings - Fork 45
timers: Replace del_timer_sync() with timer_delete_sync() for Linux >= 6.1.84 #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
timers: Replace del_timer_sync() with timer_delete_sync() for Linux >= 6.1.84 #77
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since v6.1.84
, del_timer_sync()
has been redefined as a wrapper for timer_delete_sync()
, which is defined in timer.h
.
6.1.84
is where the rename happened, not 6.15.0
. So checking for 6.15
is too conservative.
Avoiding the wrapper (even if present) is good practice in new code.
You should also modify your commit message description.
e.g.
The "del_timer_sync()" function was renamed to "timer_delete_sync()" in kernel 6.1.84
as part of a naming consistency cleanup. The old function remains as a wrapper for
backward compatibility but is discouraged for use in new code.
Update the version check to use 6.1.84 instead of 6.15.0, so that newer kernels call
"timer_delete_sync()" directly and avoid relying on the deprecated wrapper.
ref:
commit 8fa7292fee5c5240402371ea89ab285ec856c916
Author: Thomas Gleixner [email protected]
Date: Sat Apr 5 10:17:26 2025 +0200
treewide: Switch/rename to timer_delete[_sync]()
timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree
over and remove the historical wrapper inlines.
Conversion was done with coccinelle plus manual fixups where necessary.
Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
commit 9b13df3fb64ee95e2397585404e442afee2c7d4f
Author: Thomas Gleixner [email protected]
Date: Wed Nov 23 21:18:44 2022 +0100
timers: Rename del_timer_sync() to timer_delete_sync()
The timer related functions do not have a strict timer_ prefixed namespace
which is really annoying.
Rename del_timer_sync() to timer_delete_sync() and provide del_timer_sync()
as a wrapper. Document that del_timer_sync() is not for new code.
Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Guenter Roeck <[email protected]>
Reviewed-by: Steven Rostedt (Google) <[email protected]>
Reviewed-by: Jacob Keller <[email protected]>
Reviewed-by: Anna-Maria Behnsen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
e21e3a4
to
5b52fac
Compare
Thanks @jychen0611 for the suggestion. Version check has been updated to |
5b52fac
to
a77fec4
Compare
Change the subject of this pull request as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase the latest main
branch and refine the subject.
a77fec4
to
c19af9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refine git commit messages.
Update timer deletion to use the new timer_delete_sync() interface introduced in Linux commit 9b13df3f ("timers: Rename del_timer_sync() to timer_delete_sync()"), which replaces the older del_timer_sync() for naming consistency. The legacy del_timer_sync() interface remains as an inline wrapper but is discouraged for new code. Compatibility is maintained using a version check against KERNEL_VERSION(6, 1, 84).
c19af9c
to
75f36f5
Compare
To align with the changes introduced in Linux kernel version 6.15, this commit replaces the deprecated del_timer_sync() with timer_delete_sync(), which now serves as its functional replacement. The function parameters remain unchanged, making this a direct drop-in fix.
ref:
torvalds/linux@9b13df3