Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Lukasz Dorau <lukasz.dorau@intel.com>
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org, maciej.patelczyk@intel.com
Subject: [PATCH] Grow.c: fix uninitialized variables compilation-time error
Date: Tue, 13 Nov 2012 13:29:43 +0100	[thread overview]
Message-ID: <20121113122943.4041.51702.stgit@gklab-128-085.igk.intel.com> (raw)

It fixes the following uninitialized variables compilation-time error:
WARN  - Grow.c: In function ‘reshape_array’:
WARN  - Grow.c:2413:21: error: ‘min_space_after’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
WARN  - Grow.c:2376:39: note: ‘min_space_after’ was declared here
WARN  - Grow.c:2414:22: error: ‘min_space_before’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
WARN  - Grow.c:2376:21: note: ‘min_space_before’ was declared here
WARN  - cc1: all warnings being treated as errors
WARN  - make: *** [Grow.o] Error 1
It occurs during compilation of mdadm on Fedora 17.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
---
 Grow.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Grow.c b/Grow.c
index 4de8029..a526a65 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2373,7 +2373,7 @@ release:
 static void get_space_after(int fd, struct supertype *st, struct mdinfo *info)
 {
 	struct mdinfo *sra, *sd;
-	unsigned long long min_space_before, min_space_after;
+	unsigned long long min_space_before = 0, min_space_after = 0;
 	int first = 1;
 
 	sra = sysfs_read(fd, 0, GET_DEVS);

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

             reply	other threads:[~2012-11-13 12:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-13 12:29 Lukasz Dorau [this message]
2012-11-19  0:18 ` [PATCH] Grow.c: fix uninitialized variables compilation-time error NeilBrown

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=20121113122943.4041.51702.stgit@gklab-128-085.igk.intel.com \
    --to=lukasz.dorau@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=maciej.patelczyk@intel.com \
    --cc=neilb@suse.de \
    /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