Skip to contentSkip to conversation

btrfs: remove dead code

PATCH New Dan Carpenter 1 participant 1 message Jan 7, 2010 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: remove dead code

rb_node cannot be an ERR_PTR() here. Both implimentations of __tree_search() return either a valid pointer or NULL.

It doesn't make a runtime difference but without this patch smatch thinks that lookup_extent_mapping() can return an ERR_PTR(). It can wait until 2.6.34 obviously.

fs/btrfs/extent_map.c +0 -4
@@ -349,10 +349,6 @@ struct extent_map *lookup_extent_mapping
 		em = NULL;
 		goto out;
 	}
-	if (IS_ERR(rb_node)) {
-		em = ERR_PTR(PTR_ERR(rb_node));
-		goto out;
-	}
 	em = rb_entry(rb_node, struct extent_map, rb_node);
 	if (end > em->start && start < extent_map_end(em))
 		goto found;