posix-cpu-timers: Remove pointless return value check
authorThomas Gleixner <tglx@linutronix.de>
Wed, 21 Aug 2019 19:08:59 +0000 (21:08 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 28 Aug 2019 09:50:30 +0000 (11:50 +0200)
set_process_cpu_timer() checks already whether the clock id is valid. No
point in checking the return value of the sample function. That allows to
simplify the sample function later.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/20190821192920.339725769@linutronix.de
kernel/time/posix-cpu-timers.c

index aff7e3b64d848f41d7e17b68e9dd97040eb893bf..5944b7494be7d4244f4b431716d8c7e366c3085e 100644 (file)
@@ -1190,14 +1190,13 @@ void set_process_cpu_timer(struct task_struct *tsk, unsigned int clock_idx,
                           u64 *newval, u64 *oldval)
 {
        u64 now;
-       int ret;
 
        if (WARN_ON_ONCE(clock_idx >= CPUCLOCK_SCHED))
                return;
 
-       ret = cpu_clock_sample_group(clock_idx, tsk, &now, true);
+       cpu_clock_sample_group(clock_idx, tsk, &now, true);
 
-       if (oldval && ret != -EINVAL) {
+       if (oldval) {
                /*
                 * We are setting itimer. The *oldval is absolute and we update
                 * it to be relative, *newval argument is relative and we update