aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/list_debug.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/lib/list_debug.c b/lib/list_debug.c
index 45c03fd608dd..1a39f4e3ae1f 100644
--- a/lib/list_debug.c
+++ b/lib/list_debug.c
@@ -20,18 +20,14 @@ void __list_add(struct list_head *new,
20 struct list_head *prev, 20 struct list_head *prev,
21 struct list_head *next) 21 struct list_head *next)
22{ 22{
23 if (unlikely(next->prev != prev)) { 23 WARN(next->prev != prev,
24 printk(KERN_ERR "list_add corruption. next->prev should be " 24 "list_add corruption. next->prev should be "
25 "prev (%p), but was %p. (next=%p).\n", 25 "prev (%p), but was %p. (next=%p).\n",
26 prev, next->prev, next); 26 prev, next->prev, next);
27 BUG(); 27 WARN(prev->next != next,
28 } 28 "list_add corruption. prev->next should be "
29 if (unlikely(prev->next != next)) { 29 "next (%p), but was %p. (prev=%p).\n",
30 printk(KERN_ERR "list_add corruption. prev->next should be " 30 next, prev->next, prev);
31 "next (%p), but was %p. (prev=%p).\n",
32 next, prev->next, prev);
33 BUG();
34 }
35 next->prev = new; 31 next->prev = new;
36 new->next = next; 32 new->next = next;
37 new->prev = prev; 33 new->prev = prev;
@@ -47,16 +43,12 @@ EXPORT_SYMBOL(__list_add);
47 */ 43 */
48void list_del(struct list_head *entry) 44void list_del(struct list_head *entry)
49{ 45{
50 if (unlikely(entry->prev->next != entry)) { 46 WARN(entry->prev->next != entry,
51 printk(KERN_ERR "list_del corruption. prev->next should be %p, " 47 "list_del corruption. prev->next should be %p, "
52 "but was %p\n", entry, entry->prev->next); 48 "but was %p\n", entry, entry->prev->next);
53 BUG(); 49 WARN(entry->next->prev != entry,
54 } 50 "list_del corruption. next->prev should be %p, "
55 if (unlikely(entry->next->prev != entry)) { 51 "but was %p\n", entry, entry->next->prev);
56 printk(KERN_ERR "list_del corruption. next->prev should be %p, "
57 "but was %p\n", entry, entry->next->prev);
58 BUG();
59 }
60 __list_del(entry->prev, entry->next); 52 __list_del(entry->prev, entry->next);
61 entry->next = LIST_POISON1; 53 entry->next = LIST_POISON1;
62 entry->prev = LIST_POISON2; 54 entry->prev = LIST_POISON2;