Commit 8af49607 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl/clock: drop meaningless parameter from clock_sleep()



clock_sleep() only accepts absolute timespecs, so we have no use of a
pointer for collecting the remaining sleep time upon interrupt.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
parent 9332f2a3
......@@ -18,7 +18,6 @@
struct evl_clock_sleepreq {
struct timespec timeout;
struct timespec *remain;
};
#define EVL_CLKIOC_SLEEP _IOWR(EVL_CLOCK_IOCBASE, 0, struct evl_clock_sleepreq)
......
......@@ -10,7 +10,7 @@
#include <linux/types.h>
#include <uapi/evl/sched.h>
#define EVL_ABI_LEVEL 6
#define EVL_ABI_LEVEL 7
#define EVL_CONTROL_DEV "/dev/evl/control"
......
......@@ -429,10 +429,13 @@ static long restart_clock_sleep(struct restart_block *param)
static int clock_sleep(struct evl_clock *clock,
struct evl_clock_sleepreq __user *u_req)
{
struct evl_clock_sleepreq req = {
.timeout = {
.tv_sec = 0, .tv_nsec = 0
},
};
struct evl_thread *curr = evl_current();
struct evl_clock_sleepreq req;
struct restart_block *restart;
struct timespec remain;
ktime_t timeout, rem;
int ret;
......@@ -449,17 +452,8 @@ static int clock_sleep(struct evl_clock *clock,
if (curr->local_info & T_SYSRST) {
curr->local_info &= ~T_SYSRST;
restart = &current->restart_block;
if (restart->fn != restart_clock_sleep) {
if (req.remain) {
rem = evl_get_stopped_timer_delta(&curr->rtimer);
remain = ktime_to_timespec(rem);
ret = raw_copy_to_user(req.remain, &remain,
sizeof(remain));
if (ret)
return -EFAULT;
}
if (restart->fn != restart_clock_sleep)
return -EINTR;
}
timeout = restart->nanosleep.expires;
} else
timeout = timespec_to_ktime(req.timeout);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment