[PATCH] alpha/osf_sys: use helper functions to convert between tv and jiffies
Use helper functions to convert between timeval structure and jiffies rather than custom logic. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Domen Puncer <domen@coderock.org> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
3407c0fec3
commit
24d568ed1b
@@ -1150,16 +1150,13 @@ osf_usleep_thread(struct timeval32 __user *sleep, struct timeval32 __user *remai
|
|||||||
if (get_tv32(&tmp, sleep))
|
if (get_tv32(&tmp, sleep))
|
||||||
goto fault;
|
goto fault;
|
||||||
|
|
||||||
ticks = tmp.tv_usec;
|
ticks = timeval_to_jiffies(&tmp);
|
||||||
ticks = (ticks + (1000000 / HZ) - 1) / (1000000 / HZ);
|
|
||||||
ticks += tmp.tv_sec * HZ;
|
|
||||||
|
|
||||||
current->state = TASK_INTERRUPTIBLE;
|
current->state = TASK_INTERRUPTIBLE;
|
||||||
ticks = schedule_timeout(ticks);
|
ticks = schedule_timeout(ticks);
|
||||||
|
|
||||||
if (remain) {
|
if (remain) {
|
||||||
tmp.tv_sec = ticks / HZ;
|
jiffies_to_timeval(ticks, &tmp);
|
||||||
tmp.tv_usec = ticks % HZ;
|
|
||||||
if (put_tv32(remain, &tmp))
|
if (put_tv32(remain, &tmp))
|
||||||
goto fault;
|
goto fault;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user