]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fix MTIME_SEC_MAX on 32-bit
authorThomas Gleixner <tglx@linutronix.de>
Fri, 16 Mar 2007 22:15:57 +0000 (14:15 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 23 Mar 2007 19:49:23 +0000 (12:49 -0700)
The maximum seconds value we can handle on 32bit is LONG_MAX.

Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/ktime.h

index 611f17f79eefe32f78605589f175db8a77616474..83ae2e78a7818a4474b7f502653e68b905d0a44f 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: