Skip to contentSkip to conversation

master - cleanup: gcc can't see the code path

PATCH Zdenek Kabelac 1 participant 1 message Dec 5, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=74878bc2bcd66d60a0b53f409a30271496acd348
Commit:        74878bc2bcd66d60a0b53f409a30271496acd348
Parent:        ac6cd9baa7dac621cae58d545080599dcc281413
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Dec 5 09:41:03 2013 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Thu Dec 5 09:42:50 2013 +0100

cleanup: gcc can't see the code path

This is a bit to hard for gcc to see the condition can't be triggered, so make it easier and initialize to 0.

---
 tools/lvconvert.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
tools/lvconvert.c +1 -2
index 11ee21a..87eb643 100644
@@ -1803,8 +1803,7 @@ static void _lvconvert_raid_repair_ask(struct cmd_context *cmd, int *replace_dev
 
 static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *lp)
 {
-	int replace = 0;
-	int uninitialized_var(image_count);
+	int replace = 0, image_count = 0;
 	struct dm_list *failed_pvs;
 	struct cmd_context *cmd = lv->vg->cmd;
 	struct lv_segment *seg = first_seg(lv);