Re: [PATCH v2] timer: Introduce mod_timer_msec()

From: Dmitry Torokhov
Date: Sat Jan 02 2010 - 14:30:24 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/