diff options
-rw-r--r-- | lib/rbtree_test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c index af38aedbd874..99515038ff6d 100644 --- a/lib/rbtree_test.c +++ b/lib/rbtree_test.c | |||
@@ -117,8 +117,7 @@ static int black_path_count(struct rb_node *rb) | |||
117 | static void check(int nr_nodes) | 117 | static void check(int nr_nodes) |
118 | { | 118 | { |
119 | struct rb_node *rb; | 119 | struct rb_node *rb; |
120 | int count = 0; | 120 | int count = 0, blacks = 0; |
121 | int blacks = 0; | ||
122 | u32 prev_key = 0; | 121 | u32 prev_key = 0; |
123 | 122 | ||
124 | for (rb = rb_first(&root); rb; rb = rb_next(rb)) { | 123 | for (rb = rb_first(&root); rb; rb = rb_next(rb)) { |
@@ -134,7 +133,9 @@ static void check(int nr_nodes) | |||
134 | prev_key = node->key; | 133 | prev_key = node->key; |
135 | count++; | 134 | count++; |
136 | } | 135 | } |
136 | |||
137 | WARN_ON_ONCE(count != nr_nodes); | 137 | WARN_ON_ONCE(count != nr_nodes); |
138 | WARN_ON_ONCE(count < (1 << black_path_count(rb_last(&root))) - 1); | ||
138 | } | 139 | } |
139 | 140 | ||
140 | static void check_augmented(int nr_nodes) | 141 | static void check_augmented(int nr_nodes) |