summaryrefslogtreecommitdiffstats
path: root/kernel/locking
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2023-08-02 15:42:03 -0700
committerFrederic Weisbecker <frederic@kernel.org>2023-09-24 17:24:01 +0200
commit84cee9e72e15b65921f05d41788d66a79c1baa25 (patch)
tree7da606679ae9204f3bd253870a3c50a1c1c7a3cb /kernel/locking
parent31742a56c676b6014fde99a0cf07d3d12b822e9a (diff)
downloadlinux-84cee9e72e15b65921f05d41788d66a79c1baa25.tar.gz
linux-84cee9e72e15b65921f05d41788d66a79c1baa25.tar.bz2
linux-84cee9e72e15b65921f05d41788d66a79c1baa25.zip
locktorture: Consolidate "if" statements in lock_torture_writer()
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>
Diffstat (limited to 'kernel/locking')
-rw-r--r--kernel/locking/locktorture.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index 57ee16cf879d..c8c322e69a90 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -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);