rbtree/test: move rb_node to the middle of the test struct
authorCody P Schafer <cody@linux.vnet.ibm.com>
Thu, 23 Jan 2014 23:56:05 +0000 (15:56 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 00:37:03 +0000 (16:37 -0800)
Avoid making the rb_node the first entry to catch some bugs around NULL
checking the rb_node.

Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/rbtree_test.c

index 31dd4ccd3baae800a4459088cca01ca560c3a536..df6c125ff5c21b149cee4bf397dab1608247f6fc 100644 (file)
@@ -8,8 +8,8 @@
 #define CHECK_LOOPS 100
 
 struct test_node {
-       struct rb_node rb;
        u32 key;
+       struct rb_node rb;
 
        /* following fields used for testing augmented rbtree functionality */
        u32 val;