posix-cpu-timers: Remove the stub nanosleep functions
authorThomas Gleixner <tglx@linutronix.de>
Tue, 1 Feb 2011 13:51:45 +0000 (13:51 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 2 Feb 2011 14:28:14 +0000 (15:28 +0100)
CLOCK_THREAD_CPUTIME_ID implements stub functions for nanosleep and
nanosleep_restart, which return -EINVAL. That return value is
wrong. The correct return value is -ENOTSUP.

Remove the stubs and let the new dispatch code return the correct
error code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <johnstul@us.ibm.com>
Tested-by: Richard Cochran <richard.cochran@omicron.at>
LKML-Reference: <20110201134418.422446502@linutronix.de>

kernel/posix-cpu-timers.c

index 9e617b00afa9bb28d5fc051f8d03e2463f3209d1..8dc4cd7faf8956528ffb62535516426156b840d5 100644 (file)
@@ -1586,15 +1586,6 @@ static int thread_cpu_timer_create(struct k_itimer *timer)
        timer->it_clock = THREAD_CLOCK;
        return posix_cpu_timer_create(timer);
 }
-static int thread_cpu_nsleep(const clockid_t which_clock, int flags,
-                             struct timespec *rqtp, struct timespec __user *rmtp)
-{
-       return -EINVAL;
-}
-static long thread_cpu_nsleep_restart(struct restart_block *restart_block)
-{
-       return -EINVAL;
-}
 
 struct k_clock clock_posix_cpu = {
        .clock_getres   = posix_cpu_clock_getres,
@@ -1623,8 +1614,6 @@ static __init int init_posix_cpu_timers(void)
                .clock_get      = thread_cpu_clock_get,
                .clock_set      = do_posix_clock_nosettime,
                .timer_create   = thread_cpu_timer_create,
-               .nsleep         = thread_cpu_nsleep,
-               .nsleep_restart = thread_cpu_nsleep_restart,
        };
        struct timespec ts;