lkml.org 
[lkml]   [2022]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [patch V2 13/17] timers: Split [try_to_]del_timer[_sync]() to prepare for shutdown mode
From


On 11/22/2022 9:45 AM, Thomas Gleixner wrote:
> +/**
> + * try_to_del_timer_sync - Try to deactivate a timer
> + * @timer: Timer to deactivate
> + *
> + * This function tries to deactivate a timer. On success the timer is not
> + * queued and the timer callback function is not running on any CPU.
> + *
> + * This function does not guarantee that the timer cannot be rearmed right
> + * after dropping the base lock. That needs to be prevented by the calling
> + * code if necessary.
> + *
> + * Return:
> + * * %0 - The timer was not pending
> + * * %1 - The timer was pending and deactivated
> + * * %-1 - The timer callback function is running on a different CPU
> + */
> +int try_to_del_timer_sync(struct timer_list *timer)
> +{
> + return __try_to_del_timer_sync(timer);
> +}
> EXPORT_SYMBOL(try_to_del_timer_sync);
>


Its a bit odd to me that some patches refactor and replace functions
with new variants all under timer_* namespace, but then we've left some
of them available without that.

Any reasoning behind this? I guess "try_*" is pretty clear and unlikely
to get stolen by other code..?

Thanks,
Jake

\
 
 \ /
  Last update: 2022-11-23 00:06    [W:0.209 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site