Skip to contentSkip to conversation

master - cleanup: drop impossible test case

PATCH Zdenek Kabelac 1 participant 1 message Dec 4, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=10f37345ebbd4822083bd9451f59df6074995bb8
Commit:        10f37345ebbd4822083bd9451f59df6074995bb8
Parent:        1f6d79ab4827929420e032f4fb77e03393f336a8
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Dec 4 11:28:31 2017 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Dec 4 15:38:50 2017 +0100

cleanup: drop impossible test case

This test can never be true since info is embeded struct.

---
 libdm/libdm-deptree.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
libdm/libdm-deptree.c +1 -6
index 9bc16c9..d0b4658 100644
@@ -1025,7 +1025,7 @@ out:
 static int _node_clear_table(struct dm_tree_node *dnode, uint16_t udev_flags)
 {
 	struct dm_task *dmt = NULL, *deps_dmt = NULL;
-	struct dm_info *info, deps_info;
+	struct dm_info *info = &dnode->info, deps_info;
 	struct dm_deps *deps = NULL;
 	const char *name, *uuid, *depname, *depuuid;
 	const char *default_uuid_prefix;
@@ -1033,11 +1033,6 @@ static int _node_clear_table(struct dm_tree_node *dnode, uint16_t udev_flags)
 	uint32_t i;
 	int r = 0;
 
-	if (!(info = &dnode->info)) {
-		log_error("_node_clear_table failed: missing info");
-		return 0;
-	}
-
 	if (!(name = dm_tree_node_get_name(dnode))) {
 		log_error("_node_clear_table failed: missing name");
 		return 0;