linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: fix uninitialized warining in btrfs_calc_stripe_index
@ 2014-10-02  0:32 Anand Jain
  2014-10-06 17:19 ` David Sterba
  0 siblings, 1 reply; 5+ messages in thread
From: Anand Jain @ 2014-10-02  0:32 UTC (permalink / raw)
  To: linux-btrfs

chunk-recover.c: In function ‘btrfs_calc_stripe_index’:
chunk-recover.c:1481: warning: ‘index’ may be used uninitialized in this function

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 chunk-recover.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chunk-recover.c b/chunk-recover.c
index 209d7a7..5daffe3 100644
--- a/chunk-recover.c
+++ b/chunk-recover.c
@@ -1478,7 +1478,7 @@ static int btrfs_calc_stripe_index(struct chunk_record *chunk, u64 logical)
 	u64 offset = logical - chunk->offset;
 	int stripe_nr;
 	int nr_data_stripes;
-	int index;
+	int index = 0;
 
 	stripe_nr = offset / chunk->stripe_len;
 	if (chunk->type_flags & BTRFS_BLOCK_GROUP_RAID0) {
-- 
2.0.0.153.g79dcccc


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

end of thread, other threads:[~2014-10-07  6:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-02  0:32 [PATCH] btrfs-progs: fix uninitialized warining in btrfs_calc_stripe_index Anand Jain
2014-10-06 17:19 ` David Sterba
2014-10-06 22:17   ` [PATCH v2] " Anand Jain
2014-10-06 22:20   ` [PATCH v3] btrfs-progs: fix uninitialized warning " Anand Jain
2014-10-06 22:27   ` [PATCH v4] " Anand Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).