mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[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>
This commit is contained in:
parent
09e12f9f6b
commit
3f39894d1b
2 changed files with 4 additions and 8 deletions
|
@ -101,7 +101,7 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
|
|||
static inline void
|
||||
set_normalized_timespec (struct timespec *ts, time_t sec, long nsec)
|
||||
{
|
||||
while (nsec > NSEC_PER_SEC) {
|
||||
while (nsec >= NSEC_PER_SEC) {
|
||||
nsec -= NSEC_PER_SEC;
|
||||
++sec;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue