From 14bf49fa63afbe1a74aa44968034375f0ff4fa38 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Mon, 30 Nov 2020 15:34:22 -0500 Subject: [PATCH] test_maple_tree: Fix test harness for new next/prev interface Signed-off-by: Liam R. Howlett --- lib/test_maple_tree.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index 9d264d3cd462..e16d305a8345 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -1080,9 +1080,12 @@ int mas_ce2_over_count(struct ma_state *mas_start, struct ma_state *mas_end, int count = 0, span = 0; unsigned long retry = 0; void *entry; + struct ma_state tmp; + // count slots - entry = mas_next(mas_start, mas_end->last); + memcpy(&tmp, mas_start, sizeof(tmp)); + entry = mas_next(&tmp, mas_end->last); while (entry) { BUG_ON(retry > 50); // stop infinite retry on testing. if (xa_is_zero(s_entry)) { @@ -1091,7 +1094,7 @@ int mas_ce2_over_count(struct ma_state *mas_start, struct ma_state *mas_end, } count++; span++; - entry = mas_next(mas_start, mas_end->last); + entry = mas_next(&tmp, mas_end->last); } if (null_entry) { -- 2.50.1