From patchwork Thu Oct 10 02:34:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 3013771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1757F9F1E1 for ; Thu, 10 Oct 2013 02:35:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 44630202FE for ; Thu, 10 Oct 2013 02:35:40 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72F2C202C7 for ; Thu, 10 Oct 2013 02:35:34 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VU667-0008R6-Lu; Thu, 10 Oct 2013 02:35:31 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VU665-0007jD-3j; Thu, 10 Oct 2013 02:35:29 +0000 Received: from intranet.asianux.com ([58.214.24.6]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VU660-0007iV-JM for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2013 02:35:26 +0000 Received: by intranet.asianux.com (Postfix, from userid 103) id 4C962184040B; Thu, 10 Oct 2013 10:35:02 +0800 (CST) X-Spam-Score: -100.8 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from [10.1.100.108] (unknown [61.148.203.198]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by intranet.asianux.com (Postfix) with ESMTP id C2B541840242; Thu, 10 Oct 2013 10:35:01 +0800 (CST) Message-ID: <5256121A.9030504@asianux.com> Date: Thu, 10 Oct 2013 10:34:02 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Martin Schwidefsky , Heiko Carstens , Russell King - ARM Linux , Catalin Marinas , Will Deacon Subject: [PATCH 2/3] arm: include: asm: atomic.h: use 'unsigned int' and 'atomic' instead of 'unsigned long' for atomic_clear_mask() References: <52561137.3070608@asianux.com> <5256117A.4000009@asianux.com> In-Reply-To: <5256117A.4000009@asianux.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131009_223525_048544_171CD60C X-CRM114-Status: GOOD ( 11.67 ) X-Spam-Score: -2.1 (--) Cc: linux390@de.ibm.com, "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , linux-s390@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In current kernel wide source, for arm, only s390 scsi drivers use atomic_clear_mask(), now, s390 itself need use 'unsigned int' and 'atomic_t', so need match s390's atomic_clear_mask(). Signed-off-by: Chen Gang --- arch/arm/include/asm/atomic.h | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h index da1c77d..0832a7f 100644 --- a/arch/arm/include/asm/atomic.h +++ b/arch/arm/include/asm/atomic.h @@ -134,9 +134,10 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new) return oldval; } -static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) +static inline void atomic_clear_mask(unsigned int mask, atomic_t *ptr) { - unsigned long tmp, tmp2; + unsigned int tmp; + unsigned long tmp2; __asm__ __volatile__("@ atomic_clear_mask\n" "1: ldrex %0, [%3]\n" @@ -144,8 +145,8 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) " strex %1, %0, [%3]\n" " teq %1, #0\n" " bne 1b" - : "=&r" (tmp), "=&r" (tmp2), "+Qo" (*addr) - : "r" (addr), "Ir" (mask) + : "=&r" (tmp), "=&r" (tmp2), "+Qo" (ptr->counter) + : "r" (&ptr->counter), "Ir" (mask) : "cc"); } @@ -197,12 +198,12 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new) return ret; } -static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) +static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) { unsigned long flags; raw_local_irq_save(flags); - *addr &= ~mask; + v->counter &= ~mask; raw_local_irq_restore(flags); }