public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib/rbtree_test.c: fix uninitialized variable warning
@ 2012-12-11 10:16 Cong Ding
  0 siblings, 0 replies; only message in thread
From: Cong Ding @ 2012-12-11 10:16 UTC (permalink / raw)
  To: Andrew Morton, Michel Lespinasse, Rik van Riel, Akinobu Mita,
	David Woodhouse, linux-kernel
  Cc: Cong Ding

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@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-12-11 10:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-11 10:16 [PATCH] lib/rbtree_test.c: fix uninitialized variable warning Cong Ding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox