lkml.org 
[lkml]   [2010]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] timer: Introduce mod_timer_msec()
On Sat, Jan 02, 2010 at 11:21:08AM -0800, Arjan van de Ven wrote:
> /**
> + * mod_timer_msec - modify a timer's timeout, using relative milliseconds
> + * @timer: the timer to be modified
> + * @delay_ms: the desired minimum delay in milliseconds
> + *
> + * Changes the timeout of a timer similar to mod_timer().
> + *
> + * mod_timer_msec() takes relative milliseconds rather than absolute
> + * jiffies as argument.
> + *
> + * The function returns whether it has modified a pending timer or not.
> + * (ie. mod_timer_msec() of an inactive timer returns 0, mod_timer_msec() of
> + * an active timer returns 1.)
> + */
> +int mod_timer_msec(struct timer_list *timer, unsigned long delay_ms)
> +{
> + return mod_timer(timer, jiffies + msecs_to_jiffies(delay_ms));
> +}
> +EXPORT_SYMBOL(mod_timer_msec);

I wonder why isn't this an inline function? Seems tiny enough... Other
than that - I'll gladly take input conversion patches.

Thanks.

--
Dmitry


\
 
 \ /
  Last update: 2010-01-02 20:33    [W:0.057 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site