aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_xarray.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/test_xarray.c')
-rw-r--r--lib/test_xarray.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/test_xarray.c b/lib/test_xarray.c
index a885afde0aef..dc02eff562b8 100644
--- a/lib/test_xarray.c
+++ b/lib/test_xarray.c
@@ -357,7 +357,7 @@ static noinline void check_cmpxchg(struct xarray *xa)
357static noinline void check_reserve(struct xarray *xa) 357static noinline void check_reserve(struct xarray *xa)
358{ 358{
359 void *entry; 359 void *entry;
360 unsigned long index = 0; 360 unsigned long index;
361 361
362 /* An array with a reserved entry is not empty */ 362 /* An array with a reserved entry is not empty */
363 XA_BUG_ON(xa, !xa_empty(xa)); 363 XA_BUG_ON(xa, !xa_empty(xa));
@@ -393,7 +393,7 @@ static noinline void check_reserve(struct xarray *xa)
393 xa_reserve(xa, 6, GFP_KERNEL); 393 xa_reserve(xa, 6, GFP_KERNEL);
394 xa_store_index(xa, 7, GFP_KERNEL); 394 xa_store_index(xa, 7, GFP_KERNEL);
395 395
396 xa_for_each(xa, entry, index, ULONG_MAX, XA_PRESENT) { 396 xa_for_each(xa, index, entry) {
397 XA_BUG_ON(xa, index != 5 && index != 7); 397 XA_BUG_ON(xa, index != 5 && index != 7);
398 } 398 }
399 xa_destroy(xa); 399 xa_destroy(xa);
@@ -812,17 +812,16 @@ static noinline void check_find_1(struct xarray *xa)
812static noinline void check_find_2(struct xarray *xa) 812static noinline void check_find_2(struct xarray *xa)
813{ 813{
814 void *entry; 814 void *entry;
815 unsigned long i, j, index = 0; 815 unsigned long i, j, index;
816 816
817 xa_for_each(xa, entry, index, ULONG_MAX, XA_PRESENT) { 817 xa_for_each(xa, index, entry) {
818 XA_BUG_ON(xa, true); 818 XA_BUG_ON(xa, true);
819 } 819 }
820 820
821 for (i = 0; i < 1024; i++) { 821 for (i = 0; i < 1024; i++) {
822 xa_store_index(xa, index, GFP_KERNEL); 822 xa_store_index(xa, index, GFP_KERNEL);
823 j = 0; 823 j = 0;
824 index = 0; 824 xa_for_each(xa, index, entry) {
825 xa_for_each(xa, entry, index, ULONG_MAX, XA_PRESENT) {
826 XA_BUG_ON(xa, xa_mk_index(index) != entry); 825 XA_BUG_ON(xa, xa_mk_index(index) != entry);
827 XA_BUG_ON(xa, index != j++); 826 XA_BUG_ON(xa, index != j++);
828 } 827 }