linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] DM RAID: validate_raid_redundancy: Silence uninitialized variable warning
@ 2013-02-20 20:31 Tim Gardner
  2013-02-20 22:16 ` Paul Menzel
  2013-02-21 13:19 ` [dm-devel] " Alasdair G Kergon
  0 siblings, 2 replies; 8+ messages in thread
From: Tim Gardner @ 2013-02-20 20:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tim Gardner, Alasdair Kergon, dm-devel, Neil Brown, linux-raid

drivers/md/dm-raid.c: In function 'raid_ctr':
drivers/md/dm-raid.c:453:53: warning: 'rebuilds_per_group' may be used uninitialized in this function [-Wuninitialized]
drivers/md/dm-raid.c:383:11: note: 'rebuilds_per_group' was declared here

It appears unlikely that rebuilds_per_group could be used before set, but set
it to 0 anyways just to shutup GCC.

Cc: Alasdair Kergon <agk@redhat.com>
Cc: dm-devel@redhat.com
Cc: Neil Brown <neilb@suse.de>
Cc: linux-raid@vger.kernel.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 drivers/md/dm-raid.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 9d6bf19..8005caf 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -380,7 +380,7 @@ static int validate_region_size(struct raid_set *rs, unsigned long region_size)
 static int validate_raid_redundancy(struct raid_set *rs)
 {
 	unsigned i, rebuild_cnt = 0;
-	unsigned rebuilds_per_group, copies, d;
+	unsigned rebuilds_per_group = 0, copies, d;
 	unsigned group_size, last_group_start;
 
 	for (i = 0; i < rs->md.raid_disks; i++)
-- 
1.7.9.5

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

end of thread, other threads:[~2013-06-13 16:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-20 20:31 [PATCH linux-next] DM RAID: validate_raid_redundancy: Silence uninitialized variable warning Tim Gardner
2013-02-20 22:16 ` Paul Menzel
2013-02-20 22:18   ` Paul Menzel
2013-02-20 22:37   ` NeilBrown
2013-02-21 13:19 ` [dm-devel] " Alasdair G Kergon
2013-02-21 14:50   ` [PATCH linux-next v2] " Tim Gardner
2013-06-13 15:30     ` Tommi Rantala
2013-06-13 16:00       ` Tim Gardner

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).