Skip to content

Commit 9e7f4d4

Browse files
Ingo MolnarLinus Torvalds
authored andcommitted
[PATCH] lockdep: rename DEBUG_WARN_ON()
Rename DEBUG_WARN_ON() to the less generic DEBUG_LOCKS_WARN_ON() name, so that it's clear that this is a lock-debugging internal mechanism. Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 61f4c3d commit 9e7f4d4

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

kernel/mutex-debug.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ void debug_mutex_set_owner(struct mutex *lock,
373373
struct thread_info *new_owner __IP_DECL__)
374374
{
375375
lock->owner = new_owner;
376-
DEBUG_WARN_ON(!list_empty(&lock->held_list));
376+
DEBUG_LOCKS_WARN_ON(!list_empty(&lock->held_list));
377377
if (debug_mutex_on) {
378378
list_add_tail(&lock->held_list, &debug_mutex_held_locks);
379379
lock->acquire_ip = ip;
@@ -389,22 +389,22 @@ void debug_mutex_init_waiter(struct mutex_waiter *waiter)
389389

390390
void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter)
391391
{
392-
SMP_DEBUG_WARN_ON(!spin_is_locked(&lock->wait_lock));
393-
DEBUG_WARN_ON(list_empty(&lock->wait_list));
394-
DEBUG_WARN_ON(waiter->magic != waiter);
395-
DEBUG_WARN_ON(list_empty(&waiter->list));
392+
SMP_DEBUG_LOCKS_WARN_ON(!spin_is_locked(&lock->wait_lock));
393+
DEBUG_LOCKS_WARN_ON(list_empty(&lock->wait_list));
394+
DEBUG_LOCKS_WARN_ON(waiter->magic != waiter);
395+
DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list));
396396
}
397397

398398
void debug_mutex_free_waiter(struct mutex_waiter *waiter)
399399
{
400-
DEBUG_WARN_ON(!list_empty(&waiter->list));
400+
DEBUG_LOCKS_WARN_ON(!list_empty(&waiter->list));
401401
memset(waiter, MUTEX_DEBUG_FREE, sizeof(*waiter));
402402
}
403403

404404
void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
405405
struct thread_info *ti __IP_DECL__)
406406
{
407-
SMP_DEBUG_WARN_ON(!spin_is_locked(&lock->wait_lock));
407+
SMP_DEBUG_LOCKS_WARN_ON(!spin_is_locked(&lock->wait_lock));
408408
check_deadlock(lock, 0, ti, ip);
409409
/* Mark the current thread as blocked on the lock: */
410410
ti->task->blocked_on = waiter;
@@ -414,9 +414,9 @@ void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
414414
void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter,
415415
struct thread_info *ti)
416416
{
417-
DEBUG_WARN_ON(list_empty(&waiter->list));
418-
DEBUG_WARN_ON(waiter->task != ti->task);
419-
DEBUG_WARN_ON(ti->task->blocked_on != waiter);
417+
DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list));
418+
DEBUG_LOCKS_WARN_ON(waiter->task != ti->task);
419+
DEBUG_LOCKS_WARN_ON(ti->task->blocked_on != waiter);
420420
ti->task->blocked_on = NULL;
421421

422422
list_del_init(&waiter->list);
@@ -425,11 +425,11 @@ void mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter,
425425

426426
void debug_mutex_unlock(struct mutex *lock)
427427
{
428-
DEBUG_WARN_ON(lock->magic != lock);
429-
DEBUG_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next);
430-
DEBUG_WARN_ON(lock->owner != current_thread_info());
428+
DEBUG_LOCKS_WARN_ON(lock->magic != lock);
429+
DEBUG_LOCKS_WARN_ON(!lock->wait_list.prev && !lock->wait_list.next);
430+
DEBUG_LOCKS_WARN_ON(lock->owner != current_thread_info());
431431
if (debug_mutex_on) {
432-
DEBUG_WARN_ON(list_empty(&lock->held_list));
432+
DEBUG_LOCKS_WARN_ON(list_empty(&lock->held_list));
433433
list_del_init(&lock->held_list);
434434
}
435435
}
@@ -456,7 +456,7 @@ void debug_mutex_init(struct mutex *lock, const char *name)
456456
*/
457457
void fastcall mutex_destroy(struct mutex *lock)
458458
{
459-
DEBUG_WARN_ON(mutex_is_locked(lock));
459+
DEBUG_LOCKS_WARN_ON(mutex_is_locked(lock));
460460
lock->magic = NULL;
461461
}
462462

kernel/mutex-debug.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ extern void debug_mutex_init(struct mutex *lock, const char *name);
6565
do { \
6666
struct mutex *l = container_of(lock, struct mutex, wait_lock); \
6767
\
68-
DEBUG_WARN_ON(in_interrupt()); \
68+
DEBUG_LOCKS_WARN_ON(in_interrupt()); \
6969
debug_spin_lock_save(&debug_mutex_lock, flags); \
7070
spin_lock(lock); \
71-
DEBUG_WARN_ON(l->magic != l); \
71+
DEBUG_LOCKS_WARN_ON(l->magic != l); \
7272
} while (0)
7373

7474
#define spin_unlock_mutex(lock, flags) \
@@ -95,7 +95,7 @@ do { \
9595
} \
9696
} while (0)
9797

98-
#define DEBUG_WARN_ON(c) \
98+
#define DEBUG_LOCKS_WARN_ON(c) \
9999
do { \
100100
if (unlikely(c && debug_mutex_on)) { \
101101
DEBUG_OFF(); \
@@ -110,10 +110,10 @@ do { \
110110
} while (0)
111111

112112
#ifdef CONFIG_SMP
113-
# define SMP_DEBUG_WARN_ON(c) DEBUG_WARN_ON(c)
114-
# define SMP_DEBUG_BUG_ON(c) DEBUG_BUG_ON(c)
113+
# define SMP_DEBUG_LOCKS_WARN_ON(c) DEBUG_LOCKS_WARN_ON(c)
114+
# define SMP_DEBUG_BUG_ON(c) DEBUG_BUG_ON(c)
115115
#else
116-
# define SMP_DEBUG_WARN_ON(c) do { } while (0)
117-
# define SMP_DEBUG_BUG_ON(c) do { } while (0)
116+
# define SMP_DEBUG_LOCKS_WARN_ON(c) do { } while (0)
117+
# define SMP_DEBUG_BUG_ON(c) do { } while (0)
118118
#endif
119119

kernel/mutex.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ __mutex_lock_common(struct mutex *lock, long state __IP_DECL__)
183183

184184
debug_mutex_free_waiter(&waiter);
185185

186-
DEBUG_WARN_ON(list_empty(&lock->held_list));
187-
DEBUG_WARN_ON(lock->owner != task->thread_info);
186+
DEBUG_LOCKS_WARN_ON(list_empty(&lock->held_list));
187+
DEBUG_LOCKS_WARN_ON(lock->owner != task->thread_info);
188188

189189
return 0;
190190
}
@@ -206,7 +206,7 @@ __mutex_unlock_slowpath(atomic_t *lock_count __IP_DECL__)
206206
struct mutex *lock = container_of(lock_count, struct mutex, count);
207207
unsigned long flags;
208208

209-
DEBUG_WARN_ON(lock->owner != current_thread_info());
209+
DEBUG_LOCKS_WARN_ON(lock->owner != current_thread_info());
210210

211211
spin_lock_mutex(&lock->wait_lock, flags);
212212

kernel/mutex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define mutex_remove_waiter(lock, waiter, ti) \
1717
__list_del((waiter)->list.prev, (waiter)->list.next)
1818

19-
#define DEBUG_WARN_ON(c) do { } while (0)
19+
#define DEBUG_LOCKS_WARN_ON(c) do { } while (0)
2020
#define debug_mutex_set_owner(lock, new_owner) do { } while (0)
2121
#define debug_mutex_clear_owner(lock) do { } while (0)
2222
#define debug_mutex_init_waiter(waiter) do { } while (0)

0 commit comments

Comments
 (0)