git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
include
/
linux
/
ktime.h
diff --git
a/include/linux/ktime.h
b/include/linux/ktime.h
index
84eeecd
..
83ae2e7
100644
(file)
--- a/
include/linux/ktime.h
+++ b/
include/linux/ktime.h
@@
-57,7
+57,11
@@
typedef union {
} ktime_t;
#define KTIME_MAX ((s64)~((u64)1 << 63))
} ktime_t;
#define KTIME_MAX ((s64)~((u64)1 << 63))
-#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
+#if (BITS_PER_LONG == 64)
+# define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
+#else
+# define KTIME_SEC_MAX LONG_MAX
+#endif
/*
* ktime_t definitions when using the 64-bit scalar representation:
/*
* ktime_t definitions when using the 64-bit scalar representation:
@@
-248,9
+252,9
@@
static inline struct timeval ktime_to_timeval(const ktime_t kt)
*
* Returns the scalar nanoseconds representation of kt
*/
*
* Returns the scalar nanoseconds representation of kt
*/
-static inline
u
64 ktime_to_ns(const ktime_t kt)
+static inline
s
64 ktime_to_ns(const ktime_t kt)
{
{
- return (
u
64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec;
+ return (
s
64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec;
}
#endif
}
#endif