Messages in this thread | | | From | "Makhlis, Lev" <> | Subject | Re: [PATCH 19/34]: include/jiffies: add usecs_to_jiffies() functi on | Date | Thu, 3 Feb 2005 10:07:15 -0600 |
| |
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/
| |