Re: [PATCH -tip 3/3] define nsecs_to_jiffies()

From: Peter Zijlstra
Date: Thu Nov 26 2009 - 05:27:34 EST


On Thu, 2009-11-26 at 14:49 +0900, Hidetoshi Seto wrote:
> Use of msecs_to_jiffies() for nsecs_to_cputime() have some problems:
>
> - The type of msecs_to_jiffies()'s argument is unsigned int, so
> it cannot convert msecs greater than UINT_MAX = about 49.7 days.
> - msecs_to_jiffies() returns MAX_JIFFY_OFFSET if MSB of argument
> is set, assuming that input was negative value. So it cannot
> convert msecs greater than INT_MAX = about 24.8 days too.
>
> This patch defines a new function nsecs_to_jiffies() that can deal
> greater values, and that can deal all incoming values as unsigned.

This looks good too,

Thanks Hidetoshi-san!
--
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/