diff options
author | George Anzinger <george@mvista.com> | 2005-11-13 19:07:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-13 21:14:17 -0500 |
commit | 3f39894d1b5c253b10fcb8fbbbcf65a330f6cdc7 (patch) | |
tree | 6d166da37e874f2c0b891d4cf61b5f4b9bf5a71f /include | |
parent | 09e12f9f6bcd9af516d901223cebdbae58b32c9f (diff) |
[PATCH] timespec: normalize off by one errors
It would appear that the timespec normalize code has an off by one error.
Found in three places. Thanks to Ben for spotting.
Signed-off-by: George Anzinger<george@mvista.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/time.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/time.h b/include/linux/time.h index 8e83f4e778bb..bfbe92d0767c 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -101,7 +101,7 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | |||
101 | static inline void | 101 | static inline void |
102 | set_normalized_timespec (struct timespec *ts, time_t sec, long nsec) | 102 | set_normalized_timespec (struct timespec *ts, time_t sec, long nsec) |
103 | { | 103 | { |
104 | while (nsec > NSEC_PER_SEC) { | 104 | while (nsec >= NSEC_PER_SEC) { |
105 | nsec -= NSEC_PER_SEC; | 105 | nsec -= NSEC_PER_SEC; |
106 | ++sec; | 106 | ++sec; |
107 | } | 107 | } |