Commit 014afa94 authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by Linus Torvalds

lib/list_sort: test: unify test messages

This patch unifies 'list_sort_test()' messages a bit and makes sure all of
them start with the "list_sort_test:" prefix to make it obvious for users
where the messages come from.
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Don Mullis <don.mullis@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f3dc0e38
...@@ -170,12 +170,12 @@ static int __init list_sort_test(void) ...@@ -170,12 +170,12 @@ static int __init list_sort_test(void)
struct list_head *cur, *tmp; struct list_head *cur, *tmp;
LIST_HEAD(head); LIST_HEAD(head);
printk(KERN_DEBUG "testing list_sort()\n"); printk(KERN_DEBUG "list_sort_test: start testing list_sort()\n");
for (i = 0; i < TEST_LIST_LEN; i++) { for (i = 0; i < TEST_LIST_LEN; i++) {
el = kmalloc(sizeof(*el), GFP_KERNEL); el = kmalloc(sizeof(*el), GFP_KERNEL);
if (!el) { if (!el) {
printk(KERN_ERR "cancel list_sort() testing - cannot " printk(KERN_ERR "list_sort_test: error: cannot "
"allocate memory\n"); "allocate memory\n");
goto exit; goto exit;
} }
...@@ -192,30 +192,31 @@ static int __init list_sort_test(void) ...@@ -192,30 +192,31 @@ static int __init list_sort_test(void)
int cmp_result; int cmp_result;
if (cur->next->prev != cur) { if (cur->next->prev != cur) {
printk(KERN_ERR "list_sort() returned " printk(KERN_ERR "list_sort_test: error: list is "
"a corrupted list!\n"); "corrupted\n");
goto exit; goto exit;
} }
cmp_result = cmp(NULL, cur, cur->next); cmp_result = cmp(NULL, cur, cur->next);
if (cmp_result > 0) { if (cmp_result > 0) {
printk(KERN_ERR "list_sort() failed to sort!\n"); printk(KERN_ERR "list_sort_test: error: list is not "
"sorted\n");
goto exit; goto exit;
} }
el = container_of(cur, struct debug_el, list); el = container_of(cur, struct debug_el, list);
el1 = container_of(cur->next, struct debug_el, list); el1 = container_of(cur->next, struct debug_el, list);
if (cmp_result == 0 && el->serial >= el1->serial) { if (cmp_result == 0 && el->serial >= el1->serial) {
printk(KERN_ERR "list_sort() failed to preserve order " printk(KERN_ERR "list_sort_test: error: order of "
"of equivalent elements!\n"); "equivalent elements not preserved\n");
goto exit; goto exit;
} }
count++; count++;
} }
if (count != TEST_LIST_LEN) { if (count != TEST_LIST_LEN) {
printk(KERN_ERR "list_sort() returned list of " printk(KERN_ERR "list_sort_test: error: bad list length %d",
"different length!\n"); count);
goto exit; goto exit;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment