Skip to content

Commit 84cee9e

Browse files
paulmckrcuFrederic Weisbecker
authored andcommitted
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 <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]>
1 parent 31742a5 commit 84cee9e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kernel/locking/locktorture.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -889,11 +889,10 @@ static int lock_torture_writer(void *arg)
889889
lock_is_write_held = true;
890890
if (WARN_ON_ONCE(atomic_read(&lock_is_read_held)))
891891
lwsp->n_lock_fail++; /* rare, but... */
892-
893892
lwsp->n_lock_acquired++;
894-
}
895-
if (!skip_main_lock) {
893+
896894
cxt.cur_ops->write_delay(&rand);
895+
897896
lock_is_write_held = false;
898897
WRITE_ONCE(last_lock_release, jiffies);
899898
cxt.cur_ops->writeunlock(tid);

0 commit comments

Comments
 (0)