From: Frank Mori Hess Date: Sat, 28 May 2005 18:54:31 +0000 (+0000) Subject: added msecs_to_jiffies() compatibility definition X-Git-Tag: branch-0_7-end~58 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c33ec61a4bd3c66f8810a15821bee4db1d348daa;p=comedi.git added msecs_to_jiffies() compatibility definition --- diff --git a/include/linux/time.h b/include/linux/time.h new file mode 100644 index 00000000..306b80fb --- /dev/null +++ b/include/linux/time.h @@ -0,0 +1,24 @@ + +#ifndef __COMPAT_LINUX_TIME_H +#define __COMPAT_LINUX_TIME_H + +#include + +#include_next + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) +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) + return m * (HZ / 1000); +#else + return (m * HZ + 999) / 1000; +#endif +}; + +#endif + +#endif +