Author: kib
Date: Fri Jul  5 01:22:16 2019
New Revision: 349758
URL: https://svnweb.freebsd.org/changeset/base/349758

Log:
  MFC r349611, r349614:
  Style.

Modified:
  stable/11/sys/kern/kern_umtx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_umtx.c
==============================================================================
--- stable/11/sys/kern/kern_umtx.c      Fri Jul  5 01:19:28 2019        
(r349757)
+++ stable/11/sys/kern/kern_umtx.c      Fri Jul  5 01:22:16 2019        
(r349758)
@@ -1066,7 +1066,6 @@ do_lock_normal(struct thread *td, struct umutex *m, ui
                        if (owner == UMUTEX_RB_NOTRECOV)
                                return (ENOTRECOVERABLE);
 
-
                        /*
                         * Try the uncontested case.  This should be
                         * done in userland.
@@ -2665,7 +2664,8 @@ do_rw_rdlock(struct thread *td, struct urwlock *rwlock
 
                /* try to lock it */
                while (!(state & wrflags)) {
-                       if (__predict_false(URWLOCK_READER_COUNT(state) == 
URWLOCK_MAX_READERS)) {
+                       if (__predict_false(URWLOCK_READER_COUNT(state) ==
+                           URWLOCK_MAX_READERS)) {
                                umtx_key_release(&uq->uq_key);
                                return (EAGAIN);
                        }
@@ -2732,7 +2732,10 @@ do_rw_rdlock(struct thread *td, struct urwlock *rwlock
                }
 
 sleep:
-               /* contention bit is set, before sleeping, increase read waiter 
count */
+               /*
+                * Contention bit is set, before sleeping, increase
+                * read waiter count.
+                */
                rv = fueword32(&rwlock->rw_blocked_readers,
                    &blocked_readers);
                if (rv == -1) {
@@ -2836,7 +2839,8 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock
                        umtx_key_release(&uq->uq_key);
                        return (EFAULT);
                }
-               while (!(state & URWLOCK_WRITE_OWNER) && 
URWLOCK_READER_COUNT(state) == 0) {
+               while ((state & URWLOCK_WRITE_OWNER) == 0 &&
+                   URWLOCK_READER_COUNT(state) == 0) {
                        rv = casueword32(&rwlock->rw_state, state,
                            &oldstate, state | URWLOCK_WRITE_OWNER);
                        if (rv == -1) {
@@ -2872,8 +2876,8 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock
                umtxq_unlock(&uq->uq_key);
 
                /*
-                * re-read the state, in case it changed between the try-lock 
above
-                * and the check below
+                * Re-read the state, in case it changed between the
+                * try-lock above and the check below.
                 */
                rv = fueword32(&rwlock->rw_state, &state);
                if (rv == -1)
@@ -2900,7 +2904,8 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock
                        break;
                }
 
-               if (!(state & URWLOCK_WRITE_OWNER) && 
URWLOCK_READER_COUNT(state) == 0) {
+               if ((state & URWLOCK_WRITE_OWNER) == 0 &&
+                   URWLOCK_READER_COUNT(state) == 0) {
                        umtxq_unbusy_unlocked(&uq->uq_key);
                        error = umtxq_check_susp(td);
                        if (error != 0)
@@ -2915,9 +2920,10 @@ sleep:
                        error = EFAULT;
                        break;
                }
-               suword32(&rwlock->rw_blocked_writers, blocked_writers+1);
+               suword32(&rwlock->rw_blocked_writers, blocked_writers + 1);
 
-               while ((state & URWLOCK_WRITE_OWNER) || 
URWLOCK_READER_COUNT(state) != 0) {
+               while ((state & URWLOCK_WRITE_OWNER) ||
+                   URWLOCK_READER_COUNT(state) != 0) {
                        umtxq_lock(&uq->uq_key);
                        umtxq_insert_queue(uq, UMTX_EXCLUSIVE_QUEUE);
                        umtxq_unbusy(&uq->uq_key);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to