mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
rcu: Simplify rcu_do_batch() by applying clamp()
This commit replaces a nested ?: sequence with clamp(). This does not reduce the number of lines of code, but it does simplify the line that it modifies. Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
This commit is contained in:
committed by
Uladzislau Rezki (Sony)
parent
012c889690
commit
5f136351ed
@@ -2584,7 +2584,7 @@ static void rcu_do_batch(struct rcu_data *rdp)
|
||||
const long npj = NSEC_PER_SEC / HZ;
|
||||
long rrn = READ_ONCE(rcu_resched_ns);
|
||||
|
||||
rrn = rrn < NSEC_PER_MSEC ? NSEC_PER_MSEC : rrn > NSEC_PER_SEC ? NSEC_PER_SEC : rrn;
|
||||
rrn = clamp(rrn, NSEC_PER_MSEC, NSEC_PER_SEC);
|
||||
tlimit = local_clock() + rrn;
|
||||
jlimit = jiffies + (rrn + npj + 1) / npj;
|
||||
jlimit_check = true;
|
||||
|
||||
Reference in New Issue
Block a user