diff options
Diffstat (limited to 'lib/list_debug.c')
| -rw-r--r-- | lib/list_debug.c | 45 | 
1 files changed, 24 insertions, 21 deletions
| diff --git a/lib/list_debug.c b/lib/list_debug.c index 7f7bfa55eb6d..a34db8d27667 100644 --- a/lib/list_debug.c +++ b/lib/list_debug.c | |||
| @@ -20,15 +20,16 @@ | |||
| 20 | bool __list_add_valid(struct list_head *new, struct list_head *prev, | 20 | bool __list_add_valid(struct list_head *new, struct list_head *prev, | 
| 21 | struct list_head *next) | 21 | struct list_head *next) | 
| 22 | { | 22 | { | 
| 23 | CHECK_DATA_CORRUPTION(next->prev != prev, | 23 | if (CHECK_DATA_CORRUPTION(next->prev != prev, | 
| 24 | "list_add corruption. next->prev should be prev (%p), but was %p. (next=%p).\n", | 24 | "list_add corruption. next->prev should be prev (%p), but was %p. (next=%p).\n", | 
| 25 | prev, next->prev, next); | 25 | prev, next->prev, next) || | 
| 26 | CHECK_DATA_CORRUPTION(prev->next != next, | 26 | CHECK_DATA_CORRUPTION(prev->next != next, | 
| 27 | "list_add corruption. prev->next should be next (%p), but was %p. (prev=%p).\n", | 27 | "list_add corruption. prev->next should be next (%p), but was %p. (prev=%p).\n", | 
| 28 | next, prev->next, prev); | 28 | next, prev->next, prev) || | 
| 29 | CHECK_DATA_CORRUPTION(new == prev || new == next, | 29 | CHECK_DATA_CORRUPTION(new == prev || new == next, | 
| 30 | "list_add double add: new=%p, prev=%p, next=%p.\n", | 30 | "list_add double add: new=%p, prev=%p, next=%p.\n", | 
| 31 | new, prev, next); | 31 | new, prev, next)) | 
| 32 | return false; | ||
| 32 | 33 | ||
| 33 | return true; | 34 | return true; | 
| 34 | } | 35 | } | 
| @@ -41,18 +42,20 @@ bool __list_del_entry_valid(struct list_head *entry) | |||
| 41 | prev = entry->prev; | 42 | prev = entry->prev; | 
| 42 | next = entry->next; | 43 | next = entry->next; | 
| 43 | 44 | ||
| 44 | CHECK_DATA_CORRUPTION(next == LIST_POISON1, | 45 | if (CHECK_DATA_CORRUPTION(next == LIST_POISON1, | 
| 45 | "list_del corruption, %p->next is LIST_POISON1 (%p)\n", | 46 | "list_del corruption, %p->next is LIST_POISON1 (%p)\n", | 
| 46 | entry, LIST_POISON1); | 47 | entry, LIST_POISON1) || | 
| 47 | CHECK_DATA_CORRUPTION(prev == LIST_POISON2, | 48 | CHECK_DATA_CORRUPTION(prev == LIST_POISON2, | 
| 48 | "list_del corruption, %p->prev is LIST_POISON2 (%p)\n", | 49 | "list_del corruption, %p->prev is LIST_POISON2 (%p)\n", | 
| 49 | entry, LIST_POISON2); | 50 | entry, LIST_POISON2) || | 
| 50 | CHECK_DATA_CORRUPTION(prev->next != entry, | 51 | CHECK_DATA_CORRUPTION(prev->next != entry, | 
| 51 | "list_del corruption. prev->next should be %p, but was %p\n", | 52 | "list_del corruption. prev->next should be %p, but was %p\n", | 
| 52 | entry, prev->next); | 53 | entry, prev->next) || | 
| 53 | CHECK_DATA_CORRUPTION(next->prev != entry, | 54 | CHECK_DATA_CORRUPTION(next->prev != entry, | 
| 54 | "list_del corruption. next->prev should be %p, but was %p\n", | 55 | "list_del corruption. next->prev should be %p, but was %p\n", | 
| 55 | entry, next->prev); | 56 | entry, next->prev)) | 
| 57 | return false; | ||
| 58 | |||
| 56 | return true; | 59 | return true; | 
| 57 | 60 | ||
| 58 | } | 61 | } | 
