]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - lib/rbtree_test.c
Merge tag 'acpi-fixes-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / lib / rbtree_test.c
index af38aedbd874f0f2ad4f5411c8bfc2187aa2c738..122f02f9941b5680b6fd9f14793e8806476bb634 100644 (file)
@@ -117,8 +117,7 @@ static int black_path_count(struct rb_node *rb)
 static void check(int nr_nodes)
 {
        struct rb_node *rb;
-       int count = 0;
-       int blacks = 0;
+       int count = 0, blacks = 0;
        u32 prev_key = 0;
 
        for (rb = rb_first(&root); rb; rb = rb_next(rb)) {
@@ -134,7 +133,9 @@ static void check(int nr_nodes)
                prev_key = node->key;
                count++;
        }
+
        WARN_ON_ONCE(count != nr_nodes);
+       WARN_ON_ONCE(count < (1 << black_path_count(rb_last(&root))) - 1);
 }
 
 static void check_augmented(int nr_nodes)
@@ -148,7 +149,7 @@ static void check_augmented(int nr_nodes)
        }
 }
 
-static int rbtree_test_init(void)
+static int __init rbtree_test_init(void)
 {
        int i, j;
        cycles_t time1, time2, time;
@@ -221,7 +222,7 @@ static int rbtree_test_init(void)
        return -EAGAIN; /* Fail will directly unload the module */
 }
 
-static void rbtree_test_exit(void)
+static void __exit rbtree_test_exit(void)
 {
        printk(KERN_ALERT "test exit\n");
 }