Lines Matching refs:i

35 	unsigned long i;  in idr_alloc_test()  local
43 for (i = 0x3ffe; i < 0x4003; i++) { in idr_alloc_test()
47 if (i < 0x4000) in idr_alloc_test()
48 item = item_create(i, 0); in idr_alloc_test()
50 item = item_create(i - 0x3fff, 0); in idr_alloc_test()
78 int i; in idr_null_test() local
93 for (i = 0; i < 10; i++) { in idr_null_test()
94 assert(idr_alloc(&idr, NULL, 0, 0, GFP_KERNEL) == i); in idr_null_test()
105 for (i = 0; i < 9; i++) { in idr_null_test()
106 idr_remove(&idr, i); in idr_null_test()
122 for (i = 1; i < 10; i++) { in idr_null_test()
123 assert(idr_alloc(&idr, NULL, 1, 0, GFP_KERNEL) == i); in idr_null_test()
132 unsigned int i; in idr_nowait_test() local
137 for (i = 0; i < 3; i++) { in idr_nowait_test()
138 struct item *item = item_create(i, 0); in idr_nowait_test()
139 assert(idr_alloc(&idr, item, i, i + 1, GFP_NOWAIT) == i); in idr_nowait_test()
150 unsigned long i; in idr_get_next_test() local
157 for(i = 0; indices[i]; i++) { in idr_get_next_test()
158 struct item *item = item_create(indices[i], 0); in idr_get_next_test()
159 assert(idr_alloc(&idr, item, indices[i], indices[i+1], in idr_get_next_test()
160 GFP_KERNEL) == indices[i]); in idr_get_next_test()
163 for(i = 0, nextid = 0; indices[i]; i++) { in idr_get_next_test()
165 assert(nextid == indices[i]); in idr_get_next_test()
225 int i, id; in idr_align_test() local
228 for (i = 0; i < 9; i++) { in idr_align_test()
229 BUG_ON(idr_alloc(idr, &name[i], 0, 0, GFP_KERNEL) != i); in idr_align_test()
234 for (i = 1; i < 10; i++) { in idr_align_test()
235 BUG_ON(idr_alloc(idr, &name[i], 0, 0, GFP_KERNEL) != i - 1); in idr_align_test()
240 for (i = 2; i < 11; i++) { in idr_align_test()
241 BUG_ON(idr_alloc(idr, &name[i], 0, 0, GFP_KERNEL) != i - 2); in idr_align_test()
246 for (i = 3; i < 12; i++) { in idr_align_test()
247 BUG_ON(idr_alloc(idr, &name[i], 0, 0, GFP_KERNEL) != i - 3); in idr_align_test()
252 for (i = 0; i < 8; i++) { in idr_align_test()
253 BUG_ON(idr_alloc(idr, &name[i], 0, 0, GFP_KERNEL) != 0); in idr_align_test()
254 BUG_ON(idr_alloc(idr, &name[i + 1], 0, 0, GFP_KERNEL) != 1); in idr_align_test()
262 for (i = 0; i < 8; i++) { in idr_align_test()
265 idr_replace(idr, &name[i], 0); in idr_align_test()
267 BUG_ON(idr_find(idr, 0) != &name[i]); in idr_align_test()
271 for (i = 0; i < 8; i++) { in idr_align_test()
272 BUG_ON(idr_alloc(idr, &name[i], 0, 0, GFP_KERNEL) != 0); in idr_align_test()
276 idr_replace(idr, &name[i + 1], 0); in idr_align_test()
342 unsigned long i; in idr_checks() local
345 for (i = 0; i < 10000; i++) { in idr_checks()
346 struct item *item = item_create(i, 0); in idr_checks()
347 assert(idr_alloc(&idr, item, 0, 20000, GFP_KERNEL) == i); in idr_checks()
352 for (i = 0; i < 5000; i++) in idr_checks()
353 item_idr_remove(&idr, i); in idr_checks()
367 for (i = 1; i < RADIX_TREE_MAP_SIZE; i++) in idr_checks()
368 assert(idr_alloc(&idr, DUMMY_PTR, 0, 0, GFP_KERNEL) == i); in idr_checks()
372 for (i = INT_MAX - 3UL; i < INT_MAX + 1UL; i++) { in idr_checks()
373 struct item *item = item_create(i, 0); in idr_checks()
374 assert(idr_alloc(&idr, item, i, i + 10, GFP_KERNEL) == i); in idr_checks()
376 assert(idr_alloc(&idr, DUMMY_PTR, i - 2, i, GFP_KERNEL) == -ENOSPC); in idr_checks()
377 assert(idr_alloc(&idr, DUMMY_PTR, i - 2, i + 10, GFP_KERNEL) == -ENOSPC); in idr_checks()
386 for (i = INT_MAX - 3UL; i < INT_MAX + 3UL; i++) { in idr_checks()
389 if (i <= INT_MAX) in idr_checks()
390 item = item_create(i, 0); in idr_checks()
392 item = item_create(i - INT_MAX - 1, 0); in idr_checks()
402 for (i = 1; i < 10000; i++) { in idr_checks()
403 struct item *item = item_create(i, 0); in idr_checks()
404 assert(idr_alloc(&idr, item, 1, 20000, GFP_KERNEL) == i); in idr_checks()
457 unsigned long i; in ida_check_conv_user() local
459 for (i = 0; i < 1000000; i++) { in ida_check_conv_user()
462 IDA_BUG_ON(&ida, ((i % IDA_BITMAP_BITS) != in ida_check_conv_user()
464 ((i % IDA_BITMAP_BITS) != 0)); in ida_check_conv_user()
467 IDA_BUG_ON(&ida, (i % IDA_BITMAP_BITS) == in ida_check_conv_user()
470 IDA_BUG_ON(&ida, id != i); in ida_check_conv_user()
479 unsigned int i; in ida_check_random() local
484 for (i = 0; i < 100000; i++) { in ida_check_random()
485 int i = rand(); in ida_check_random() local
486 int bit = i & 2047; in ida_check_random()
504 unsigned long i; in ida_simple_get_remove_test() local
506 for (i = 0; i < 10000; i++) { in ida_simple_get_remove_test()
507 assert(ida_simple_get(&ida, 0, 20000, GFP_KERNEL) == i); in ida_simple_get_remove_test()
511 for (i = 0; i < 10000; i++) { in ida_simple_get_remove_test()
512 ida_simple_remove(&ida, i); in ida_simple_get_remove_test()
543 int i, ret; in ida_leak_fn() local
547 do for (i = 0; i < 1000; i++) { in ida_leak_fn()
561 int i; in ida_thread_tests() local
563 for (i = 0; i < ARRAY_SIZE(threads); i++) in ida_thread_tests()
564 if (pthread_create(&threads[i], NULL, ida_random_fn, NULL)) { in ida_thread_tests()
569 while (i--) in ida_thread_tests()
570 pthread_join(threads[i], NULL); in ida_thread_tests()
572 for (i = 0; i < ARRAY_SIZE(threads); i++) in ida_thread_tests()
573 if (pthread_create(&threads[i], NULL, ida_leak_fn, &ida)) { in ida_thread_tests()
578 while (i--) in ida_thread_tests()
579 pthread_join(threads[i], NULL); in ida_thread_tests()