Skip to content

Commit

Permalink
[PATCH] fix MTIME_SEC_MAX on 32-bit
Browse files Browse the repository at this point in the history
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: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Thomas Gleixner authored and Linus Torvalds committed Mar 17, 2007
1 parent 014efb1 commit 5379058
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/linux/ktime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5379058

Please sign in to comment.