rcu-tasks: Convert rcu_tasks_wait_gp() for-loop to while-loop
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 15 Sep 2020 22:41:50 +0000 (15:41 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 3 Nov 2020 01:12:42 +0000 (17:12 -0800)
The infinite for-loop in rcu_tasks_wait_gp() has its only exit at the
top of the loop, so this commit does the straightforward conversion to
a while-loop, thus saving a few lines.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tasks.h

index d5d9f2d03e8a0ac9baa8186626980309f28462f0..a93271fc2572051179f6616e963dd84088619876 100644 (file)
@@ -338,14 +338,11 @@ static void rcu_tasks_wait_gp(struct rcu_tasks *rtp)
        if (fract > HZ)
                fract = HZ;
 
-       for (;;) {
+       while (!list_empty(&holdouts)) {
                bool firstreport;
                bool needreport;
                int rtst;
 
-               if (list_empty(&holdouts))
-                       break;
-
                /* Slowly back off waiting for holdouts */
                set_tasks_gp_state(rtp, RTGS_WAIT_SCAN_HOLDOUTS);
                schedule_timeout_idle(HZ/fract);