Skip to contentSkip to conversation

master - raid: drop unneeded NULL test

PATCH Zdenek Kabelac 1 participant 1 message Nov 17, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cad3568def7f82ae58c3585a94ceb377bb155167
Commit:        cad3568def7f82ae58c3585a94ceb377bb155167
Parent:        51dfba002b05cc65346b539b4b030f0c2dfffeaf
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Tue Nov 17 13:17:59 2015 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Tue Nov 17 19:01:25 2015 +0100

raid: drop unneeded NULL test

Skip testing target_pvs for NULL, we already dereference it in many other places.
If check would ever be needed - it needs to be in front of _raid_extract_images().

---
 lib/metadata/raid_manip.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/metadata/raid_manip.c +1 -1
index 4b2cb61..b99b671 100644
@@ -913,7 +913,7 @@ static int _raid_extract_images(struct logical_volume *lv, uint32_t new_count,
 				  display_lvname(seg_lv(seg, s)));
 		} else {
 			/* Conditions for second pass */
-			if (!target_pvs || !lv_is_on_pvs(seg_lv(seg, s), target_pvs) ||
+			if (!lv_is_on_pvs(seg_lv(seg, s), target_pvs) ||
 			    !lv_is_on_pvs(seg_metalv(seg, s), target_pvs))
 				continue;