linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] btrfs-progs: fix uninitialized warining in btrfs_calc_stripe_index
Date: Thu,  2 Oct 2014 08:32:01 +0800	[thread overview]
Message-ID: <1412209921-21002-1-git-send-email-anand.jain@oracle.com> (raw)

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


             reply	other threads:[~2014-10-02  8:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02  0:32 Anand Jain [this message]
2014-10-06 17:19 ` [PATCH] btrfs-progs: fix uninitialized warining in btrfs_calc_stripe_index 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412209921-21002-1-git-send-email-anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).