headers: Add timer_shutdown_sync()
PATCH 1/1 headers: Add timer_shutdown_sync()
From: Yi Cong <[email protected]>
This function need delete timer and set functionm callback to NULL
Signed-off-by Yi Cong <[email protected]>
--- backport/backport-include/linux/timer.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
backport/backport-include/linux/timer.h +14 -0
@@ -79,4 +79,18 @@ static inline int timer_delete_sync(struct timer_list *timer) }#endif /* < 6.1.84 */ +#if LINUX_VERSION_IS_LESS (6 ,2 ,0 ) +static inline int timer_shutdown_sync (struct timer_list *timer) +{ +int ret =del_timer_sync (timer); +/* +* Emulate shutdown semantics: mark as dead to prevent accidental reuse. +* Safe to do after del_timer_sync() because timer is no longer +* referenced by the timer subsystem. +*/ + timer->function =NULL ; +return ret; +} +#endif +#endif /* _BACKPORT_TIMER_H */
Signature · 1 line
2.25.1