aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/list_sort.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/list_sort.c b/lib/list_sort.c
index 2b99ff80f4b..01aff9e8082 100644
--- a/lib/list_sort.c
+++ b/lib/list_sort.c
@@ -170,12 +170,12 @@ static int __init list_sort_test(void)
170 struct list_head *cur, *tmp; 170 struct list_head *cur, *tmp;
171 LIST_HEAD(head); 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 for (i = 0; i < TEST_LIST_LEN; i++) { 175 for (i = 0; i < TEST_LIST_LEN; i++) {
176 el = kmalloc(sizeof(*el), GFP_KERNEL); 176 el = kmalloc(sizeof(*el), GFP_KERNEL);
177 if (!el) { 177 if (!el) {
178 printk(KERN_ERR "cancel list_sort() testing - cannot " 178 printk(KERN_ERR "list_sort_test: error: cannot "
179 "allocate memory\n"); 179 "allocate memory\n");
180 goto exit; 180 goto exit;
181 } 181 }
@@ -192,30 +192,31 @@ static int __init list_sort_test(void)
192 int cmp_result; 192 int cmp_result;
193 193
194 if (cur->next->prev != cur) { 194 if (cur->next->prev != cur) {
195 printk(KERN_ERR "list_sort() returned " 195 printk(KERN_ERR "list_sort_test: error: list is "
196 "a corrupted list!\n"); 196 "corrupted\n");
197 goto exit; 197 goto exit;
198 } 198 }
199 199
200 cmp_result = cmp(NULL, cur, cur->next); 200 cmp_result = cmp(NULL, cur, cur->next);
201 if (cmp_result > 0) { 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 goto exit; 204 goto exit;
204 } 205 }
205 206
206 el = container_of(cur, struct debug_el, list); 207 el = container_of(cur, struct debug_el, list);
207 el1 = container_of(cur->next, struct debug_el, list); 208 el1 = container_of(cur->next, struct debug_el, list);
208 if (cmp_result == 0 && el->serial >= el1->serial) { 209 if (cmp_result == 0 && el->serial >= el1->serial) {
209 printk(KERN_ERR "list_sort() failed to preserve order " 210 printk(KERN_ERR "list_sort_test: error: order of "
210 "of equivalent elements!\n"); 211 "equivalent elements not preserved\n");
211 goto exit; 212 goto exit;
212 } 213 }
213 count++; 214 count++;
214 } 215 }
215 216
216 if (count != TEST_LIST_LEN) { 217 if (count != TEST_LIST_LEN) {
217 printk(KERN_ERR "list_sort() returned list of " 218 printk(KERN_ERR "list_sort_test: error: bad list length %d",
218 "different length!\n"); 219 count);
219 goto exit; 220 goto exit;
220 } 221 }
221 222