Btrfs-progs: remove the unnecessary 'return -1;' at the end of bin_search
authorEric Sandeen <sandeen@redhat.com>
Fri, 26 Apr 2013 21:06:09 +0000 (16:06 -0500)
committerDavid Sterba <dsterba@suse.cz>
Fri, 9 Aug 2013 12:32:28 +0000 (14:32 +0200)
The code path should not reach there. Remove it.

[Eric Sandeen: port kernel commit 3fed40c to userspace]

Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
ctree.c

diff --git a/ctree.c b/ctree.c
index 81db06d..2495e0e 100644 (file)
--- a/ctree.c
+++ b/ctree.c
@@ -585,20 +585,18 @@ static int generic_bin_search(struct extent_buffer *eb, unsigned long p,
 static int bin_search(struct extent_buffer *eb, struct btrfs_key *key,
                      int level, int *slot)
 {
-       if (level == 0) {
+       if (level == 0)
                return generic_bin_search(eb,
                                          offsetof(struct btrfs_leaf, items),
                                          sizeof(struct btrfs_item),
                                          key, btrfs_header_nritems(eb),
                                          slot);
-       } else {
+       else
                return generic_bin_search(eb,
                                          offsetof(struct btrfs_node, ptrs),
                                          sizeof(struct btrfs_key_ptr),
                                          key, btrfs_header_nritems(eb),
                                          slot);
-       }
-       return -1;
 }
 
 struct extent_buffer *read_node_slot(struct btrfs_root *root,