summaryrefslogtreecommitdiffstats
path: root/include/linux/ktime.h
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-09-13 09:55:09 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-09-13 09:55:09 -0400
commit0bc0748dfbefacce9c6b67ab23f2c80133b598f7 (patch)
tree76946adc08a26973fcdb39fe0eb3ef5e1f8f121d /include/linux/ktime.h
parentb6397893a5ed81970e803d61ee2f1a0e79f87438 (diff)
parent95064a75ebf8744e1ff595e8cd7ff9b6c851523e (diff)
downloadop-kernel-dev-0bc0748dfbefacce9c6b67ab23f2c80133b598f7.zip
op-kernel-dev-0bc0748dfbefacce9c6b67ab23f2c80133b598f7.tar.gz
Merge branch 'master' into gfs2
Diffstat (limited to 'include/linux/ktime.h')
-rw-r--r--include/linux/ktime.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index ed3396d..84eeecd 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -56,7 +56,8 @@ typedef union {
#endif
} ktime_t;
-#define KTIME_MAX (~((u64)1 << 63))
+#define KTIME_MAX ((s64)~((u64)1 << 63))
+#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
/*
* ktime_t definitions when using the 64-bit scalar representation:
@@ -73,6 +74,10 @@ typedef union {
*/
static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
{
+#if (BITS_PER_LONG == 64)
+ if (unlikely(secs >= KTIME_SEC_MAX))
+ return (ktime_t){ .tv64 = KTIME_MAX };
+#endif
return (ktime_t) { .tv64 = (s64)secs * NSEC_PER_SEC + (s64)nsecs };
}
OpenPOWER on IntegriCloud