Skip to contentSkip to conversation

dm-raid: Fix compiler warning

PATCH New Stratos Karafotis 1 participant 1 message Apr 9, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm-raid: Fix compiler warning

Fix the following compiler warning of uninitialized variable

drivers/md/dm-raid.c: In function ‘raid_ctr’:
drivers/md/dm-raid.c:427:160: warning: ‘rebuilds_per_group’ may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/md/dm-raid.c:383:11: note: ‘rebuilds_per_group’ was declared here

---
 drivers/md/dm-raid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-raid.c +1 -1
index 1d3fe1a..8041de8 100644
@@ -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 copies, d, rebuilds_per_group = 0;
 	unsigned group_size, last_group_start;
 
 	for (i = 0; i < rs->md.raid_disks; i++)
Signature · 1 line
1.8.1.4