X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=kernel%2Fmutex-debug.c;h=f4913c3769505a10a0bfd169b6e2ad5c0f25f48c;hb=e1396065e0489f98b35021b97907ab4edbfb24e1;hp=4fcb051a8b9ebe560eb2816d829b97dfd2d09994;hpb=ab396e91bfe953db26fa1083d9c3e7a4fbe0334a;p=powerpc.git diff --git a/kernel/mutex-debug.c b/kernel/mutex-debug.c index 4fcb051a8b..f4913c3769 100644 --- a/kernel/mutex-debug.c +++ b/kernel/mutex-debug.c @@ -20,8 +20,6 @@ #include #include -#include - #include "mutex-debug.h" /* @@ -335,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 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; @@ -439,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; @@ -461,4 +460,3 @@ void fastcall mutex_destroy(struct mutex *lock) } EXPORT_SYMBOL_GPL(mutex_destroy); -