public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] btrfs: scrub: silence an uninitialized variable warning
@ 2016-03-11  8:08 Dan Carpenter
  2016-03-11 16:20 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-03-11  8:08 UTC (permalink / raw)
  To: Chris Mason
  Cc: Josef Bacik, David Sterba, linux-btrfs, linux-kernel,
	kernel-janitors

It's basically harmless if "ref_level" isn't initialized since it's only
used for an error message, but it causes a static checker warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index e42aa27..39dbdcb 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -611,7 +611,7 @@ static void scrub_print_warning(const char *errstr, struct scrub_block *sblock)
 	u64 flags = 0;
 	u64 ref_root;
 	u32 item_size;
-	u8 ref_level;
+	u8 ref_level = 0;
 	int ret;
 
 	WARN_ON(sblock->page_count < 1);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-11 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-11  8:08 [patch] btrfs: scrub: silence an uninitialized variable warning Dan Carpenter
2016-03-11 16:20 ` David Sterba

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