Skip to contentSkip to conversation

master - clean-up: Remove redundant faulty logic

PATCH Jonathan Brassow 1 participant 1 message Oct 24, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=772fa460d1ef7dede99478e30de756136ea0c7aa
Commit:        772fa460d1ef7dede99478e30de756136ea0c7aa
Parent:        4c0db84948ad616930e217f20768a4285ca67c5a
Author:        Jonathan Brassow <[email protected]>
AuthorDate:    Wed Oct 23 22:44:04 2013 -0500
Committer:     Jonathan Brassow <[email protected]>
CommitterDate: Wed Oct 23 22:44:04 2013 -0500

clean-up: Remove redundant faulty logic

Remove conditional that boils down to "if yes or no, then do". The previous condition in the statement is sufficient and the extra (always true) condition is unnecessary.

---
 tools/lvchange.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
tools/lvchange.c +2 -5
index 6ae9720..1931c03 100644
@@ -772,11 +772,8 @@ static int lvchange_writemostly(struct logical_volume *lv)
 			if (!(pv_names[i] = dm_pool_zalloc(lv->vg->vgmem, tmp_str_len + 3)))
 				return_0;
 
-			if (tmp_str_len < 3 ||
-			    ((tmp_str[tmp_str_len - 2] != ':') &&
-			     ((tmp_str[tmp_str_len - 1] != 't') ||
-			      (tmp_str[tmp_str_len - 1] != 'y') ||
-			      (tmp_str[tmp_str_len - 1] != 'n'))))
+			if ((tmp_str_len < 3) ||
+			    (tmp_str[tmp_str_len - 2] != ':'))
 				/* Default to 'y' if no mode specified */
 				sprintf(pv_names[i], "%s:y", tmp_str);
 			else