summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-07-03 00:24:29 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-03 15:27:01 -0700
commitc4e05116a2c4d8187127dbf77ab790aa57a47388 (patch)
tree58f07aed47ee4d30e9588d5a820c245faa163b09 /include
parent8b3db9c542e18b71d4820da4dd9401ee030feacb (diff)
[PATCH] lockdep: clean up rwsems
Clean up rwsems. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-i386/rwsem.h17
-rw-r--r--include/linux/rwsem-spinlock.h14
-rw-r--r--include/linux/rwsem.h24
3 files changed, 2 insertions, 53 deletions
diff --git a/include/asm-i386/rwsem.h b/include/asm-i386/rwsem.h
index be4ab859238e..558804e4a039 100644
--- a/include/asm-i386/rwsem.h
+++ b/include/asm-i386/rwsem.h
@@ -61,23 +61,11 @@ struct rw_semaphore {
#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
spinlock_t wait_lock;
struct list_head wait_list;
-#if RWSEM_DEBUG
- int debug;
-#endif
};
-/*
- * initialisation
- */
-#if RWSEM_DEBUG
-#define __RWSEM_DEBUG_INIT , 0
-#else
-#define __RWSEM_DEBUG_INIT /* */
-#endif
-
#define __RWSEM_INITIALIZER(name) \
{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \
- __RWSEM_DEBUG_INIT }
+ }
#define DECLARE_RWSEM(name) \
struct rw_semaphore name = __RWSEM_INITIALIZER(name)
@@ -87,9 +75,6 @@ static inline void init_rwsem(struct rw_semaphore *sem)
sem->count = RWSEM_UNLOCKED_VALUE;
spin_lock_init(&sem->wait_lock);
INIT_LIST_HEAD(&sem->wait_list);
-#if RWSEM_DEBUG
- sem->debug = 0;
-#endif
}
/*
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h
index f30f805080ae..d68afcc36ac9 100644
--- a/include/linux/rwsem-spinlock.h
+++ b/include/linux/rwsem-spinlock.h
@@ -32,22 +32,10 @@ struct rw_semaphore {
__s32 activity;
spinlock_t wait_lock;
struct list_head wait_list;
-#if RWSEM_DEBUG
- int debug;
-#endif
};
-/*
- * initialisation
- */
-#if RWSEM_DEBUG
-#define __RWSEM_DEBUG_INIT , 0
-#else
-#define __RWSEM_DEBUG_INIT /* */
-#endif
-
#define __RWSEM_INITIALIZER(name) \
-{ 0, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) __RWSEM_DEBUG_INIT }
+{ 0, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) }
#define DECLARE_RWSEM(name) \
struct rw_semaphore name = __RWSEM_INITIALIZER(name)
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index f99fe90732ab..93581534b915 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -9,8 +9,6 @@
#include <linux/linkage.h>
-#define RWSEM_DEBUG 0
-
#ifdef __KERNEL__
#include <linux/types.h>
@@ -26,23 +24,13 @@ struct rw_semaphore;
#include <asm/rwsem.h> /* use an arch-specific implementation */
#endif
-#ifndef rwsemtrace
-#if RWSEM_DEBUG
-extern void FASTCALL(rwsemtrace(struct rw_semaphore *sem, const char *str));
-#else
-#define rwsemtrace(SEM,FMT)
-#endif
-#endif
-
/*
* lock for reading
*/
static inline void down_read(struct rw_semaphore *sem)
{
might_sleep();
- rwsemtrace(sem,"Entering down_read");
__down_read(sem);
- rwsemtrace(sem,"Leaving down_read");
}
/*
@@ -51,9 +39,7 @@ static inline void down_read(struct rw_semaphore *sem)
static inline int down_read_trylock(struct rw_semaphore *sem)
{
int ret;
- rwsemtrace(sem,"Entering down_read_trylock");
ret = __down_read_trylock(sem);
- rwsemtrace(sem,"Leaving down_read_trylock");
return ret;
}
@@ -63,9 +49,7 @@ static inline int down_read_trylock(struct rw_semaphore *sem)
static inline void down_write(struct rw_semaphore *sem)
{
might_sleep();
- rwsemtrace(sem,"Entering down_write");
__down_write(sem);
- rwsemtrace(sem,"Leaving down_write");
}
/*
@@ -74,9 +58,7 @@ static inline void down_write(struct rw_semaphore *sem)
static inline int down_write_trylock(struct rw_semaphore *sem)
{
int ret;
- rwsemtrace(sem,"Entering down_write_trylock");
ret = __down_write_trylock(sem);
- rwsemtrace(sem,"Leaving down_write_trylock");
return ret;
}
@@ -85,9 +67,7 @@ static inline int down_write_trylock(struct rw_semaphore *sem)
*/
static inline void up_read(struct rw_semaphore *sem)
{
- rwsemtrace(sem,"Entering up_read");
__up_read(sem);
- rwsemtrace(sem,"Leaving up_read");
}
/*
@@ -95,9 +75,7 @@ static inline void up_read(struct rw_semaphore *sem)
*/
static inline void up_write(struct rw_semaphore *sem)
{
- rwsemtrace(sem,"Entering up_write");
__up_write(sem);
- rwsemtrace(sem,"Leaving up_write");
}
/*
@@ -105,9 +83,7 @@ static inline void up_write(struct rw_semaphore *sem)
*/
static inline void downgrade_write(struct rw_semaphore *sem)
{
- rwsemtrace(sem,"Entering downgrade_write");
__downgrade_write(sem);
- rwsemtrace(sem,"Leaving downgrade_write");
}
#endif /* __KERNEL__ */