diff options
author | Nathan Scott <nathans@bruce> | 2006-01-12 13:34:47 +1100 |
---|---|---|
committer | Nathan Scott <nathans@bruce> | 2006-01-12 13:34:47 +1100 |
commit | ddae9c2ea79449beb00027cf77fca6dc489f2d15 (patch) | |
tree | 047c2d7c8d6cbb0721f017514e1d83a20e278d43 /kernel | |
parent | 0d1335b3106687d87fcfa0e4d90f2a961bd7e1db (diff) | |
parent | a4fc7ab1d065a9dd89ed0e74439ef87d4a16e980 (diff) |
Merge HEAD from oss.sgi.com:/oss/git/linux-2.6.git
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/mutex-debug.c | 6 | ||||
-rw-r--r-- | kernel/mutex.c | 5 |
2 files changed, 4 insertions, 7 deletions
diff --git a/kernel/mutex-debug.c b/kernel/mutex-debug.c index 3dec7536378..f4913c37695 100644 --- a/kernel/mutex-debug.c +++ b/kernel/mutex-debug.c @@ -333,9 +333,10 @@ void mutex_debug_check_no_locks_held(struct task_struct *task) * is destroyed or reinitialized - this code checks whether there is * any held lock in the memory range of <from> to <to>: */ -void mutex_debug_check_no_locks_freed(const void *from, const void *to) +void mutex_debug_check_no_locks_freed(const void *from, unsigned long len) { struct list_head *curr, *next; + const void *to = from + len; unsigned long flags; struct mutex *lock; void *lock_addr; @@ -437,7 +438,7 @@ void debug_mutex_init(struct mutex *lock, const char *name) /* * Make sure we are not reinitializing a held lock: */ - mutex_debug_check_no_locks_freed((void *)lock, (void *)(lock + 1)); + mutex_debug_check_no_locks_freed((void *)lock, sizeof(*lock)); lock->owner = NULL; INIT_LIST_HEAD(&lock->held_list); lock->name = name; @@ -459,4 +460,3 @@ void fastcall mutex_destroy(struct mutex *lock) } EXPORT_SYMBOL_GPL(mutex_destroy); - diff --git a/kernel/mutex.c b/kernel/mutex.c index 5c256184419..5449b210d9e 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c @@ -202,7 +202,7 @@ __mutex_lock_slowpath(atomic_t *lock_count __IP_DECL__) static fastcall noinline void __mutex_unlock_slowpath(atomic_t *lock_count __IP_DECL__) { - struct mutex *lock = container_of(lock_count, struct mutex, count); + struct mutex *lock = container_of(lock_count, struct mutex, count); DEBUG_WARN_ON(lock->owner != current_thread_info()); @@ -313,6 +313,3 @@ int fastcall mutex_trylock(struct mutex *lock) } EXPORT_SYMBOL(mutex_trylock); - - - |