locktorture: Consolidate "if" statements in lock_torture_writer()
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 2 Aug 2023 22:42:03 +0000 (15:42 -0700)
committerFrederic Weisbecker <frederic@kernel.org>
Sun, 24 Sep 2023 15:24:01 +0000 (17:24 +0200)
There is a pair of adjacent "if" statements with identical conditions in
the lock_torture_writer() function.  This commit therefore combines them.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
kernel/locking/locktorture.c

index 57ee16cf879d51cf20a11c5929b0d5822fbdfc45..c8c322e69a90bc1dfe9ea50fe6da19edb0967b75 100644 (file)
@@ -889,11 +889,10 @@ static int lock_torture_writer(void *arg)
                        lock_is_write_held = true;
                        if (WARN_ON_ONCE(atomic_read(&lock_is_read_held)))
                                lwsp->n_lock_fail++; /* rare, but... */
-
                        lwsp->n_lock_acquired++;
-               }
-               if (!skip_main_lock) {
+
                        cxt.cur_ops->write_delay(&rand);
+
                        lock_is_write_held = false;
                        WRITE_ONCE(last_lock_release, jiffies);
                        cxt.cur_ops->writeunlock(tid);