From fcdc0929c6ea051dad59818210df53fd03eaf4b1 Mon Sep 17 00:00:00 2001 From: Chris Ball Date: Mon, 7 Mar 2011 10:05:21 -0500 Subject: Fix unused-but-set errors in gcc-4.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc-4.6 (as shipped in Fedora) turns on -Wunused-but-set-variable by default, which breaks the build when combined with -Wall, e.g.: debug-tree.c: In function ‘print_extent_leaf’: debug-tree.c:45:13: error: variable ‘last_len’ set but not used [-Werror=unused-but-set-variable] debug-tree.c:44:13: error: variable ‘last’ set but not used [-Werror=unused-but-set-variable] debug-tree.c:41:21: error: variable ‘item’ set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors This patch fixes the errors by removing the unused variables. Signed-off-by: Chris Ball Signed-off-by: Hugo Mills --- extent-cache.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'extent-cache.c') diff --git a/extent-cache.c b/extent-cache.c index b871e18f..3dd6434e 100644 --- a/extent-cache.c +++ b/extent-cache.c @@ -96,13 +96,11 @@ int insert_existing_cache_extent(struct cache_tree *tree, struct cache_extent *pe) { struct rb_node *found; - struct cache_extent *entry; found = tree_insert(&tree->root, pe->start, pe->size, &pe->rb_node); - if (found) { - entry = rb_entry(found, struct cache_extent, rb_node); + if (found) return -EEXIST; - } + return 0; } -- cgit v1.2.3