lib/list_sort: test: unify test messages
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 26 Oct 2010 21:23:08 +0000 (14:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Oct 2010 23:52:19 +0000 (16:52 -0700)
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: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Don Mullis <don.mullis@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

lib/list_sort.c

index 2b99ff8..01aff9e 100644 (file)
@@ -170,12 +170,12 @@ static int __init list_sort_test(void)
        struct list_head *cur, *tmp;
        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++) {
                el = kmalloc(sizeof(*el), GFP_KERNEL);
                if (!el) {
-                       printk(KERN_ERR "cancel list_sort() testing - cannot "
+                       printk(KERN_ERR "list_sort_test: error: cannot "
                                        "allocate memory\n");
                        goto exit;
                }
@@ -192,30 +192,31 @@ static int __init list_sort_test(void)
                int cmp_result;
 
                if (cur->next->prev != cur) {
-                       printk(KERN_ERR "list_sort() returned "
-                                       "a corrupted list!\n");
+                       printk(KERN_ERR "list_sort_test: error: list is "
+                                       "corrupted\n");
                        goto exit;
                }
 
                cmp_result = cmp(NULL, cur, cur->next);
                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;
                }
 
                el = container_of(cur, struct debug_el, list);
                el1 = container_of(cur->next, struct debug_el, list);
                if (cmp_result == 0 && el->serial >= el1->serial) {
-                       printk(KERN_ERR "list_sort() failed to preserve order "
-                                       "of equivalent elements!\n");
+                       printk(KERN_ERR "list_sort_test: error: order of "
+                                       "equivalent elements not preserved\n");
                        goto exit;
                }
                count++;
        }
 
        if (count != TEST_LIST_LEN) {
-               printk(KERN_ERR "list_sort() returned list of "
-                               "different length!\n");
+               printk(KERN_ERR "list_sort_test: error: bad list length %d",
+                               count);
                goto exit;
        }