Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

locking/rwsem: Remove unnecessary atomic_long_t casts

Since sem->count had been changed to a atomic_long_t type, it is no
longer necessary to use the atomic_long_t cast anymore. So remove them.

Signed-off-by: Waiman Long <longman@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arch@vger.kernel.org
Link: http://lkml.kernel.org/r/1484836312-6656-1-git-send-email-longman@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Waiman Long and committed by
Ingo Molnar
06321dd2 85b36c93

+6 -7
+6 -7
include/asm-generic/rwsem.h
··· 33 33 */ 34 34 static inline void __down_read(struct rw_semaphore *sem) 35 35 { 36 - if (unlikely(atomic_long_inc_return_acquire((atomic_long_t *)&sem->count) <= 0)) 36 + if (unlikely(atomic_long_inc_return_acquire(&sem->count) <= 0)) 37 37 rwsem_down_read_failed(sem); 38 38 } 39 39 ··· 58 58 long tmp; 59 59 60 60 tmp = atomic_long_add_return_acquire(RWSEM_ACTIVE_WRITE_BIAS, 61 - (atomic_long_t *)&sem->count); 61 + &sem->count); 62 62 if (unlikely(tmp != RWSEM_ACTIVE_WRITE_BIAS)) 63 63 rwsem_down_write_failed(sem); 64 64 } ··· 68 68 long tmp; 69 69 70 70 tmp = atomic_long_add_return_acquire(RWSEM_ACTIVE_WRITE_BIAS, 71 - (atomic_long_t *)&sem->count); 71 + &sem->count); 72 72 if (unlikely(tmp != RWSEM_ACTIVE_WRITE_BIAS)) 73 73 if (IS_ERR(rwsem_down_write_failed_killable(sem))) 74 74 return -EINTR; ··· 91 91 { 92 92 long tmp; 93 93 94 - tmp = atomic_long_dec_return_release((atomic_long_t *)&sem->count); 94 + tmp = atomic_long_dec_return_release(&sem->count); 95 95 if (unlikely(tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0)) 96 96 rwsem_wake(sem); 97 97 } ··· 102 102 static inline void __up_write(struct rw_semaphore *sem) 103 103 { 104 104 if (unlikely(atomic_long_sub_return_release(RWSEM_ACTIVE_WRITE_BIAS, 105 - (atomic_long_t *)&sem->count) < 0)) 105 + &sem->count) < 0)) 106 106 rwsem_wake(sem); 107 107 } 108 108 ··· 120 120 * read-locked region is ok to be re-ordered into the 121 121 * write side. As such, rely on RELEASE semantics. 122 122 */ 123 - tmp = atomic_long_add_return_release(-RWSEM_WAITING_BIAS, 124 - (atomic_long_t *)&sem->count); 123 + tmp = atomic_long_add_return_release(-RWSEM_WAITING_BIAS, &sem->count); 125 124 if (tmp < 0) 126 125 rwsem_downgrade_wake(sem); 127 126 }