lkml.org 
[lkml]   [2005]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 19/34]: include/jiffies: add usecs_to_jiffies() functi on
Date
Nishanth Aravamudan <nacc@us.ibm.com> wrote:

> +static inline unsigned long usecs_to_jiffies(const unsigned int u)
> +{
> + if (u > jiffies_to_usecs(MAX_JIFFY_OFFSET))
> + return MAX_JIFFY_OFFSET;
> +#if HZ <= 1000 && !(1000 % HZ)
> + return (u + (1000000 / HZ) - 1000) / (1000000 / HZ);
> +#elif HZ > 1000 && !(HZ % 1000)
> + return u * (HZ / 1000000);
> +#else
> + return (u * HZ + 999999) / 1000000;
> +#endif
> +}

Shouldn't this use 1000000 instead of 1000 everywhere?
It returns 0 if HZ=10000.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.034 / U:0.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site