fix MTIME_SEC_MAX on 32-bit
authorThomas Gleixner <tglx@linutronix.de>
Sun, 8 Apr 2007 22:54:30 +0000 (00:54 +0200)
committerAdrian Bunk <bunk@stusta.de>
Sun, 8 Apr 2007 22:54:30 +0000 (00:54 +0200)
The maximum seconds value we can handle on 32bit is LONG_MAX.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
include/linux/ktime.h

index f106701d7dbd87cab64662070e67f2fdf99be02f..4548ddb3cfc3061bd5a8e412708c47fc0da1d310 100644 (file)
@@ -57,7 +57,11 @@ typedef union {
 } 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: