diff options
Diffstat (limited to 'v4l/compat.h')
-rw-r--r-- | v4l/compat.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/v4l/compat.h b/v4l/compat.h index ebbea9492..01d0c0635 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -1,5 +1,5 @@ /* - * $Id: compat.h,v 1.28 2005/10/27 04:56:18 mkrufky Exp $ + * $Id: compat.h,v 1.29 2005/11/06 17:01:47 mchehab Exp $ */ #ifndef _COMPAT_H @@ -86,21 +86,25 @@ static inline unsigned long msecs_to_jiffies(const unsigned int m) { #if HZ <= 1000 && !(1000 % HZ) return (m + (1000 / HZ) - 1) / (1000 / HZ); -#elif HZ > 1000 && !(HZ % 1000) +#else +#if HZ > 1000 && !(HZ % 1000) return m * (HZ / 1000); #else return (m * HZ + 999) / 1000; #endif +#endif } static inline unsigned int jiffies_to_msecs(const unsigned long j) { #if HZ <= 1000 && !(1000 % HZ) return (1000 / HZ) * j; -#elif HZ > 1000 && !(HZ % 1000) +#else +#if HZ > 1000 && !(HZ % 1000) return (j + (HZ / 1000) - 1)/(HZ / 1000); #else return (j * 1000) / HZ; #endif +#endif } static inline void msleep(unsigned int msecs) { |