[PATCH] lib/rbtree_test.c: fix uninitialized variable warning

From: Cong Ding
Date: Tue Dec 11 2012 - 05:16:35 EST


this patch is to fix the following compilation warning:
lib/rbtree_test.c: In function âcheckâ:
lib/rbtree_test.c:121: warning: âblacksâ may be used uninitialized in this
function

the use of variable blacks in line 133 might be uninitialized

Signed-off-by: Cong Ding <dinggnu@xxxxxxxxx>
---
lib/rbtree_test.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c
index da96578..af38aed 100644
--- a/lib/rbtree_test.c
+++ b/lib/rbtree_test.c
@@ -118,7 +118,7 @@ static void check(int nr_nodes)
{
struct rb_node *rb;
int count = 0;
- int blacks;
+ int blacks = 0;
u32 prev_key = 0;

for (rb = rb_first(&root); rb; rb = rb_next(rb)) {
--
1.7.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/