diff options
author | Lukasz Dorau <lukasz.dorau@intel.com> | 2012-11-13 13:29:43 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-11-20 12:12:03 +1100 |
commit | f3f09a520fcadc94df067c780586636be0d262c7 (patch) | |
tree | 3935c397a261267c2f8c7ec2796533b903fe7afc /Grow.c | |
parent | 98a92cff5a5120483dea7e51fa10ebb05f7826da (diff) |
Grow.c: fix uninitialized variables compilation-time error
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>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r-- | Grow.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2375,7 +2375,8 @@ 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; + /* Initialisation to silence compiler warning */ + unsigned long long min_space_before = 0, min_space_after = 0; int first = 1; sra = sysfs_read(fd, 0, GET_DEVS); |