Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 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>

authored by

Artem Bityutskiy and committed by
Linus Torvalds
014afa94 f3dc0e38

+10 -9
+10 -9
lib/list_sort.c
··· 170 170 struct list_head *cur, *tmp; 171 171 LIST_HEAD(head); 172 172 173 - printk(KERN_DEBUG "testing list_sort()\n"); 173 + printk(KERN_DEBUG "list_sort_test: start testing list_sort()\n"); 174 174 175 175 for (i = 0; i < TEST_LIST_LEN; i++) { 176 176 el = kmalloc(sizeof(*el), GFP_KERNEL); 177 177 if (!el) { 178 - printk(KERN_ERR "cancel list_sort() testing - cannot " 178 + printk(KERN_ERR "list_sort_test: error: cannot " 179 179 "allocate memory\n"); 180 180 goto exit; 181 181 } ··· 192 192 int cmp_result; 193 193 194 194 if (cur->next->prev != cur) { 195 - printk(KERN_ERR "list_sort() returned " 196 - "a corrupted list!\n"); 195 + printk(KERN_ERR "list_sort_test: error: list is " 196 + "corrupted\n"); 197 197 goto exit; 198 198 } 199 199 200 200 cmp_result = cmp(NULL, cur, cur->next); 201 201 if (cmp_result > 0) { 202 - printk(KERN_ERR "list_sort() failed to sort!\n"); 202 + printk(KERN_ERR "list_sort_test: error: list is not " 203 + "sorted\n"); 203 204 goto exit; 204 205 } 205 206 206 207 el = container_of(cur, struct debug_el, list); 207 208 el1 = container_of(cur->next, struct debug_el, list); 208 209 if (cmp_result == 0 && el->serial >= el1->serial) { 209 - printk(KERN_ERR "list_sort() failed to preserve order " 210 - "of equivalent elements!\n"); 210 + printk(KERN_ERR "list_sort_test: error: order of " 211 + "equivalent elements not preserved\n"); 211 212 goto exit; 212 213 } 213 214 count++; 214 215 } 215 216 216 217 if (count != TEST_LIST_LEN) { 217 - printk(KERN_ERR "list_sort() returned list of " 218 - "different length!\n"); 218 + printk(KERN_ERR "list_sort_test: error: bad list length %d", 219 + count); 219 220 goto exit; 220 221 } 221 222