public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 19/34]: include/jiffies: add usecs_to_jiffies() functi on
@ 2005-02-03 16:07 Makhlis, Lev
  2005-02-03 18:48 ` [UPDATE PATCH 19/34]: include/jiffies: add usecs_to_jiffies() function Nishanth Aravamudan
  0 siblings, 1 reply; 3+ messages in thread
From: Makhlis, Lev @ 2005-02-03 16:07 UTC (permalink / raw)
  To: nacc, linux-kernel

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-02-04  1:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-03 16:07 [PATCH 19/34]: include/jiffies: add usecs_to_jiffies() functi on Makhlis, Lev
2005-02-03 18:48 ` [UPDATE PATCH 19/34]: include/jiffies: add usecs_to_jiffies() function Nishanth Aravamudan
2005-02-04  1:11   ` [UPDATE PATCH]: include/jiffies: fix usecs_to_jiffies()/jiffies_to_usecs() math Nishanth Aravamudan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox