From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754416AbcEQArG (ORCPT ); Mon, 16 May 2016 20:47:06 -0400 Received: from g1t6225.austin.hp.com ([15.73.96.126]:52470 "EHLO g1t6225.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751870AbcEQArF (ORCPT ); Mon, 16 May 2016 20:47:05 -0400 From: Jason Low To: Peter Zijlstra , Ingo Molnar Cc: linux-kernel@vger.kernel.org, Andrew Morton , Richard Henderson , Linus Torvalds , Ivan Kokshaysky , Matt Turner , Tony Luck , Fenghua Yu , Martin Schwidefsky , Terry Rudd , Heiko Carstens , Thomas Gleixner , Arnd Bergmann , Christoph Lameter , Davidlohr Bueso , Waiman Long , Tim Chen , Peter Hurley , Jason Low , Jason Low Subject: [RFC][PATCH 4/7] locking,alpha: Remove Alpha rwsem add and rwsem update Date: Mon, 16 May 2016 17:38:03 -0700 Message-Id: <1463445486-16078-5-git-send-email-jason.low2@hpe.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463445486-16078-1-git-send-email-jason.low2@hpe.com> References: <1463445486-16078-1-git-send-email-jason.low2@hpe.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The rwsem count has been converted to an atomic variable and the rwsem code now directly uses atomic_long_add() and atomic_long_add_return(), so we can remove the alpha implementation of rwsem_atomic_add() and rwsem_atomic_update(). Signed-off-by: Jason Low --- arch/alpha/include/asm/rwsem.h | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/arch/alpha/include/asm/rwsem.h b/arch/alpha/include/asm/rwsem.h index 0131a70..a217bf8 100644 --- a/arch/alpha/include/asm/rwsem.h +++ b/arch/alpha/include/asm/rwsem.h @@ -191,47 +191,5 @@ static inline void __downgrade_write(struct rw_semaphore *sem) rwsem_downgrade_wake(sem); } -static inline void rwsem_atomic_add(long val, struct rw_semaphore *sem) -{ -#ifndef CONFIG_SMP - sem->count += val; -#else - long temp; - __asm__ __volatile__( - "1: ldq_l %0,%1\n" - " addq %0,%2,%0\n" - " stq_c %0,%1\n" - " beq %0,2f\n" - ".subsection 2\n" - "2: br 1b\n" - ".previous" - :"=&r" (temp), "=m" (sem->count) - :"Ir" (val), "m" (sem->count)); -#endif -} - -static inline long rwsem_atomic_update(long val, struct rw_semaphore *sem) -{ -#ifndef CONFIG_SMP - sem->count += val; - return sem->count; -#else - long ret, temp; - __asm__ __volatile__( - "1: ldq_l %0,%1\n" - " addq %0,%3,%2\n" - " addq %0,%3,%0\n" - " stq_c %2,%1\n" - " beq %2,2f\n" - ".subsection 2\n" - "2: br 1b\n" - ".previous" - :"=&r" (ret), "=m" (sem->count), "=&r" (temp) - :"Ir" (val), "m" (sem->count)); - - return ret; -#endif -} - #endif /* __KERNEL__ */ #endif /* _ALPHA_RWSEM_H */ -- 2.1.4