From: Thomas Gleixner Date: Fri, 16 Mar 2007 22:15:57 +0000 (-0800) Subject: [PATCH] fix MTIME_SEC_MAX on 32-bit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5379058b718ac6354ba99cc74d10c28d632dc28a;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [PATCH] fix MTIME_SEC_MAX on 32-bit The maximum seconds value we can handle on 32bit is LONG_MAX. Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/ktime.h b/include/linux/ktime.h index c68c7ac6b232..248305bb9a18 100644 --- 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)) -#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: