summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2003-01-02 01:09:28 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2003-01-02 01:09:28 -0800
commit8bde3aa9073fcb0961431a7aad3ed27c52b62268 (patch)
tree7d37de485831ea5bb133991f60ede475264e8cb8 /include/linux
parent50b6a4a52b83a314a40d4bfaae6f278cfa635f7b (diff)
[PATCH] better compat_jiffies_to_clock_t
By a suggestion from David Mosberger: use this new version of compat_jiffies_to_clock_t, which is more appropriate on 64-bit hosts that don't have overflow issues. It does better rounding and will not fail if COMPAT_USER_HZ > HZ.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/compat.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 62daefb17672..3f634baef539 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -9,9 +9,11 @@
#ifdef CONFIG_COMPAT
#include <linux/stat.h>
+#include <linux/param.h> /* for HZ */
#include <asm/compat.h>
-#define compat_jiffies_to_clock_t(x) ((x) / (HZ / COMPAT_USER_HZ))
+#define compat_jiffies_to_clock_t(x) \
+ (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
struct compat_utimbuf {
compat_time_t actime;