itimer.c (8dd06ef34b6e2f41b29fbf5fc1663780f2524285) itimer.c (cb47755725da7b90fecbb2aa82ac3b24a7adb89b)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 1992 Darren Senn
4 */
5
6/* These are all the functions necessary to implement itimers */
7
8#include <linux/mm.h>

--- 158 unchanged lines hidden (view full) ---

167
168static void set_cpu_itimer(struct task_struct *tsk, unsigned int clock_id,
169 const struct itimerspec64 *const value,
170 struct itimerspec64 *const ovalue)
171{
172 u64 oval, nval, ointerval, ninterval;
173 struct cpu_itimer *it = &tsk->signal->it[clock_id];
174
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 1992 Darren Senn
4 */
5
6/* These are all the functions necessary to implement itimers */
7
8#include <linux/mm.h>

--- 158 unchanged lines hidden (view full) ---

167
168static void set_cpu_itimer(struct task_struct *tsk, unsigned int clock_id,
169 const struct itimerspec64 *const value,
170 struct itimerspec64 *const ovalue)
171{
172 u64 oval, nval, ointerval, ninterval;
173 struct cpu_itimer *it = &tsk->signal->it[clock_id];
174
175 /*
176 * Use the to_ktime conversion because that clamps the maximum
177 * value to KTIME_MAX and avoid multiplication overflows.
178 */
179 nval = timespec64_to_ns(&value->it_value);
180 ninterval = timespec64_to_ns(&value->it_interval);
181
182 spin_lock_irq(&tsk->sighand->siglock);
183
184 oval = it->expires;
185 ointerval = it->incr;
186 if (oval || nval) {

--- 221 unchanged lines hidden ---
175 nval = timespec64_to_ns(&value->it_value);
176 ninterval = timespec64_to_ns(&value->it_interval);
177
178 spin_lock_irq(&tsk->sighand->siglock);
179
180 oval = it->expires;
181 ointerval = it->incr;
182 if (oval || nval) {

--- 221 unchanged lines hidden ---