10 # define jiffies_to_clock_t(x) ((x) / (HZ / USER_HZ))
12 # define jiffies_to_clock_t(x) ((clock_t) jiffies_64_to_clock_t((u64) x))
15 static inline unsigned long clock_t_to_jiffies(unsigned long x)
18 if (x >= ~0UL / (HZ / USER_HZ))
20 return x * (HZ / USER_HZ);
24 /* Don't worry about loss of precision here .. */
25 if (x >= ~0UL / HZ * USER_HZ)
28 /* .. but do try to contain it here */
35 static inline u64 jiffies_64_to_clock_t(u64 x)
38 do_div(x, HZ / USER_HZ);
41 * There are better ways that don't overflow early,
42 * but even this doesn't overflow in hundreds of years