Patchwork [v2,02/11] rbtree/test: move rb_node to the middle of the test struct

login
register
mail settings
Submitter Cody P Schafer
Date Nov. 7, 2013, 1:42 a.m.
Message ID <1383788572-25938-3-git-send-email-cody@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/289105/
State Not Applicable
Headers show

Comments

Cody P Schafer - Nov. 7, 2013, 1:42 a.m.
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>
---
 lib/rbtree_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Michel Lespinasse - Nov. 7, 2013, 11:52 a.m.
On Wed, Nov 6, 2013 at 5:42 PM, Cody P Schafer <cody@linux.vnet.ibm.com> wrote:
> 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>
> ---
>  lib/rbtree_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c
> index 31dd4cc..df6c125 100644
> --- a/lib/rbtree_test.c
> +++ b/lib/rbtree_test.c
> @@ -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;

Acked-by: Michel Lespinasse <walken@google.com>

Patch

diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c
index 31dd4cc..df6c125 100644
--- a/lib/rbtree_test.c
+++ b/lib/rbtree_test.c
@@ -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;