summaryrefslogtreecommitdiffstats
path: root/kernel/time/posix-timers.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2024-06-10 18:42:26 +0200
committerFrederic Weisbecker <frederic@kernel.org>2024-07-29 21:57:35 +0200
commitbfa408f03fc74bcfe8f275a434294bde06eabb00 (patch)
treef9a676ba47f423185a1cd3326148a0efeaf35004 /kernel/time/posix-timers.c
parentposix-cpu-timers: Simplify posix_cpu_timer_set() (diff)
downloadlinux-bfa408f03fc74bcfe8f275a434294bde06eabb00.tar.xz
linux-bfa408f03fc74bcfe8f275a434294bde06eabb00.zip
posix-timers: Retrieve interval in common timer_settime() code
No point in doing this all over the place. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Reviewed-by: Anna-Maria Behnsen <anna-maria@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Diffstat (limited to 'kernel/time/posix-timers.c')
-rw-r--r--kernel/time/posix-timers.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index b924f0f096fa..056966b9d7da 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -904,7 +904,7 @@ static int do_timer_settime(timer_t timer_id, int tmr_flags,
const struct k_clock *kc;
struct k_itimer *timr;
unsigned long flags;
- int error = 0;
+ int error;
if (!timespec64_valid(&new_spec64->it_interval) ||
!timespec64_valid(&new_spec64->it_value))
@@ -918,6 +918,9 @@ retry:
if (!timr)
return -EINVAL;
+ if (old_spec64)
+ old_spec64->it_interval = ktime_to_timespec64(timr->it_interval);
+
kc = timr->kclock;
if (WARN_ON_ONCE(!kc || !kc->timer_set))
error = -EINVAL;