|
@@ -56,7 +56,8 @@ typedef union {
|
|
#endif
|
|
#endif
|
|
} ktime_t;
|
|
} 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:
|
|
* 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)
|
|
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 };
|
|
return (ktime_t) { .tv64 = (s64)secs * NSEC_PER_SEC + (s64)nsecs };
|
|
}
|
|
}
|
|
|
|
|