diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-08-08 16:21:02 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-08-08 16:21:02 -0400 |
| commit | e4ddcb0a6bf04d53ce77b4eb87bbbb32c4261d11 (patch) | |
| tree | d27d2fea50a384d97aa2d0cf5c8657c916f761d4 /lib/list_debug.c | |
| parent | f2afa7711f8585ffc088ba538b9a510e0d5dca12 (diff) | |
| parent | 6e86841d05f371b5b9b86ce76c02aaee83352298 (diff) | |
Merge commit 'v2.6.27-rc1' into for-linus
Diffstat (limited to 'lib/list_debug.c')
| -rw-r--r-- | lib/list_debug.c | 50 |
1 files changed, 14 insertions, 36 deletions
diff --git a/lib/list_debug.c b/lib/list_debug.c index 4350ba9655bd..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; |
| @@ -40,20 +36,6 @@ void __list_add(struct list_head *new, | |||
| 40 | EXPORT_SYMBOL(__list_add); | 36 | EXPORT_SYMBOL(__list_add); |
| 41 | 37 | ||
| 42 | /** | 38 | /** |
| 43 | * list_add - add a new entry | ||
| 44 | * @new: new entry to be added | ||
| 45 | * @head: list head to add it after | ||
| 46 | * | ||
| 47 | * Insert a new entry after the specified head. | ||
| 48 | * This is good for implementing stacks. | ||
| 49 | */ | ||
| 50 | void list_add(struct list_head *new, struct list_head *head) | ||
| 51 | { | ||
| 52 | __list_add(new, head, head->next); | ||
| 53 | } | ||
| 54 | EXPORT_SYMBOL(list_add); | ||
| 55 | |||
| 56 | /** | ||
| 57 | * list_del - deletes entry from list. | 39 | * list_del - deletes entry from list. |
| 58 | * @entry: the element to delete from the list. | 40 | * @entry: the element to delete from the list. |
| 59 | * Note: list_empty on entry does not return true after this, the entry is | 41 | * Note: list_empty on entry does not return true after this, the entry is |
| @@ -61,16 +43,12 @@ EXPORT_SYMBOL(list_add); | |||
| 61 | */ | 43 | */ |
| 62 | void list_del(struct list_head *entry) | 44 | void list_del(struct list_head *entry) |
| 63 | { | 45 | { |
| 64 | if (unlikely(entry->prev->next != entry)) { | 46 | WARN(entry->prev->next != entry, |
| 65 | printk(KERN_ERR "list_del corruption. prev->next should be %p, " | 47 | "list_del corruption. prev->next should be %p, " |
| 66 | "but was %p\n", entry, entry->prev->next); | 48 | "but was %p\n", entry, entry->prev->next); |
| 67 | BUG(); | 49 | WARN(entry->next->prev != entry, |
| 68 | } | 50 | "list_del corruption. next->prev should be %p, " |
| 69 | if (unlikely(entry->next->prev != entry)) { | 51 | "but was %p\n", entry, entry->next->prev); |
| 70 | printk(KERN_ERR "list_del corruption. next->prev should be %p, " | ||
| 71 | "but was %p\n", entry, entry->next->prev); | ||
| 72 | BUG(); | ||
| 73 | } | ||
| 74 | __list_del(entry->prev, entry->next); | 52 | __list_del(entry->prev, entry->next); |
| 75 | entry->next = LIST_POISON1; | 53 | entry->next = LIST_POISON1; |
| 76 | entry->prev = LIST_POISON2; | 54 | entry->prev = LIST_POISON2; |
