public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Thomas Gleixner <tglx@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	peterz@infradead.org, chris@zankel.net, lethal@linux-sh.org,
	tony.luck@intel.com, davem@davemloft.net, dhowells@redhat.com,
	benh@kernel.crashing.org, mattst88@gmail.com,
	heiko.carstens@de.ibm.com, tglx@linutronix.de
Subject: [tip:core/locking] x86: Cleanup rwsem_count_t typedef
Date: Thu, 27 Jan 2011 11:56:05 GMT	[thread overview]
Message-ID: <tip-bde11efbc21ea84c3351464a422b467eaefabb9a@git.kernel.org> (raw)
In-Reply-To: <20110126195833.580335506@linutronix.de>

Commit-ID:  bde11efbc21ea84c3351464a422b467eaefabb9a
Gitweb:     http://git.kernel.org/tip/bde11efbc21ea84c3351464a422b467eaefabb9a
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Wed, 26 Jan 2011 20:05:53 +0000
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 27 Jan 2011 12:30:38 +0100

x86: Cleanup rwsem_count_t typedef

Remove the typedef which has no real reason to be there.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: David Miller <davem@davemloft.net>
Cc: Chris Zankel <chris@zankel.net>
LKML-Reference: <20110126195833.580335506@linutronix.de>

---
 arch/x86/include/asm/rwsem.h |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86/include/asm/rwsem.h
index a626cff..c30206c 100644
--- a/arch/x86/include/asm/rwsem.h
+++ b/arch/x86/include/asm/rwsem.h
@@ -68,10 +68,8 @@ extern asmregparm struct rw_semaphore *
 #define RWSEM_ACTIVE_READ_BIAS		RWSEM_ACTIVE_BIAS
 #define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
 
-typedef signed long rwsem_count_t;
-
 struct rw_semaphore {
-	rwsem_count_t		count;
+	long			count;
 	spinlock_t		wait_lock;
 	struct list_head	wait_list;
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
@@ -127,7 +125,7 @@ static inline void __down_read(struct rw_semaphore *sem)
  */
 static inline int __down_read_trylock(struct rw_semaphore *sem)
 {
-	rwsem_count_t result, tmp;
+	long result, tmp;
 	asm volatile("# beginning __down_read_trylock\n\t"
 		     "  mov          %0,%1\n\t"
 		     "1:\n\t"
@@ -149,7 +147,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
  */
 static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
 {
-	rwsem_count_t tmp;
+	long tmp;
 	asm volatile("# beginning down_write\n\t"
 		     LOCK_PREFIX "  xadd      %1,(%2)\n\t"
 		     /* adds 0xffff0001, returns the old value */
@@ -174,9 +172,8 @@ static inline void __down_write(struct rw_semaphore *sem)
  */
 static inline int __down_write_trylock(struct rw_semaphore *sem)
 {
-	rwsem_count_t ret = cmpxchg(&sem->count,
-				    RWSEM_UNLOCKED_VALUE,
-				    RWSEM_ACTIVE_WRITE_BIAS);
+	long ret = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
+			   RWSEM_ACTIVE_WRITE_BIAS);
 	if (ret == RWSEM_UNLOCKED_VALUE)
 		return 1;
 	return 0;
@@ -187,7 +184,7 @@ static inline int __down_write_trylock(struct rw_semaphore *sem)
  */
 static inline void __up_read(struct rw_semaphore *sem)
 {
-	rwsem_count_t tmp;
+	long tmp;
 	asm volatile("# beginning __up_read\n\t"
 		     LOCK_PREFIX "  xadd      %1,(%2)\n\t"
 		     /* subtracts 1, returns the old value */
@@ -205,7 +202,7 @@ static inline void __up_read(struct rw_semaphore *sem)
  */
 static inline void __up_write(struct rw_semaphore *sem)
 {
-	rwsem_count_t tmp;
+	long tmp;
 	asm volatile("# beginning __up_write\n\t"
 		     LOCK_PREFIX "  xadd      %1,(%2)\n\t"
 		     /* subtracts 0xffff0001, returns the old value */
@@ -241,8 +238,7 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
 /*
  * implement atomic add functionality
  */
-static inline void rwsem_atomic_add(rwsem_count_t delta,
-				    struct rw_semaphore *sem)
+static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
 {
 	asm volatile(LOCK_PREFIX _ASM_ADD "%1,%0"
 		     : "+m" (sem->count)
@@ -252,10 +248,9 @@ static inline void rwsem_atomic_add(rwsem_count_t delta,
 /*
  * implement exchange and add functionality
  */
-static inline rwsem_count_t rwsem_atomic_update(rwsem_count_t delta,
-						struct rw_semaphore *sem)
+static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
 {
-	rwsem_count_t tmp = delta;
+	long tmp = delta;
 
 	asm volatile(LOCK_PREFIX "xadd %0,%1"
 		     : "+r" (tmp), "+m" (sem->count)

  reply	other threads:[~2011-01-27 11:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-26 20:05 [patch 0/6] rwsem: Cleanup duplicate code all over the place Thomas Gleixner
2011-01-26 20:05 ` [patch 1/6] rwsem: Cleanup includes Thomas Gleixner
2011-01-27  4:43   ` David Miller
2011-01-27 11:55   ` [tip:core/locking] " tip-bot for Thomas Gleixner
2011-01-26 20:05 ` [patch 2/6] x86: Cleanup rwsem_count_t typedef Thomas Gleixner
2011-01-27 11:56   ` tip-bot for Thomas Gleixner [this message]
2011-01-26 20:05 ` [patch 3/6] rwsem: Move duplicate struct rwsem declaration to linux/rwsem.h Thomas Gleixner
2011-01-27  4:44   ` David Miller
2011-01-27 11:56   ` [tip:core/locking] " tip-bot for Thomas Gleixner
2011-01-26 20:06 ` [patch 4/6] rwsem: Move duplicate init macros and functions " Thomas Gleixner
2011-01-27  4:45   ` David Miller
2011-01-27 11:56   ` [tip:core/locking] " tip-bot for Thomas Gleixner
2011-01-26 20:06 ` [patch 5/6] rwsem: Unify the duplicate rwsem_is_locked() inlines Thomas Gleixner
2011-01-27  4:45   ` David Miller
2011-01-27 11:57   ` [tip:core/locking] " tip-bot for Thomas Gleixner
2011-01-26 20:06 ` [patch 6/6] rwsem: Move duplicate function prototypes to linux/rwsem.h Thomas Gleixner
2011-01-26 20:32   ` rwsem: rwsem: Remove redundant asmregparm annotation Thomas Gleixner
2011-01-27 11:58     ` [tip:core/locking] " tip-bot for Thomas Gleixner
2011-01-27 15:03     ` rwsem: " David Howells
2011-01-27 15:12       ` Thomas Gleixner
2011-01-27  4:45   ` [patch 6/6] rwsem: Move duplicate function prototypes to linux/rwsem.h David Miller
2011-01-27 11:57   ` [tip:core/locking] " tip-bot for Thomas Gleixner
2011-01-26 22:55 ` [patch 0/6] rwsem: Cleanup duplicate code all over the place Tony Luck
2011-01-27  6:38 ` Heiko Carstens
2011-01-27 14:54 ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-bde11efbc21ea84c3351464a422b467eaefabb9a@git.kernel.org \
    --to=tglx@linutronix.de \
    --cc=benh@kernel.crashing.org \
    --cc=chris@zankel.net \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox