X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2Frwsem.c;h=ceba8e28807a81c09c551e4f782091efa9bebccf;hb=7d32c0aca4fbd0319c860d12af5fae3e88c760e6;hp=7d02700a4b0e131ae0dfba2e6da6ecf75b6a8d2c;hpb=2b5baad1656d2e193308333636707ace4a2fff56;p=firefly-linux-kernel-4.4.55.git diff --git a/lib/rwsem.c b/lib/rwsem.c index 7d02700a4b0e..ceba8e28807a 100644 --- a/lib/rwsem.c +++ b/lib/rwsem.c @@ -136,9 +136,10 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading) out: return sem; - /* undo the change to count, but check for a transition 1->0 */ + /* undo the change to the active count, but check for a transition + * 1->0 */ undo: - if (rwsem_atomic_update(-RWSEM_ACTIVE_BIAS, sem) != 0) + if (rwsem_atomic_update(-RWSEM_ACTIVE_BIAS, sem) & RWSEM_ACTIVE_MASK) goto out; goto try_again; } @@ -187,7 +188,7 @@ rwsem_down_failed_common(struct rw_semaphore *sem, /* * wait for the read lock to be granted */ -struct rw_semaphore fastcall __sched * +asmregparm struct rw_semaphore __sched * rwsem_down_read_failed(struct rw_semaphore *sem) { struct rwsem_waiter waiter; @@ -201,7 +202,7 @@ rwsem_down_read_failed(struct rw_semaphore *sem) /* * wait for the write lock to be granted */ -struct rw_semaphore fastcall __sched * +asmregparm struct rw_semaphore __sched * rwsem_down_write_failed(struct rw_semaphore *sem) { struct rwsem_waiter waiter; @@ -216,7 +217,7 @@ rwsem_down_write_failed(struct rw_semaphore *sem) * handle waking up a waiter on the semaphore * - up_read/up_write has decremented the active part of count if we come here */ -struct rw_semaphore fastcall *rwsem_wake(struct rw_semaphore *sem) +asmregparm struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem) { unsigned long flags; @@ -236,7 +237,7 @@ struct rw_semaphore fastcall *rwsem_wake(struct rw_semaphore *sem) * - caller incremented waiting part of count and discovered it still negative * - just wake up any readers at the front of the queue */ -struct rw_semaphore fastcall *rwsem_downgrade_wake(struct rw_semaphore *sem) +asmregparm struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem) { unsigned long flags;