[PATCH] btrfs-progs: fix uninitialized warining in btrfs_calc_stripe_index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

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




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux