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 --- btrfsck.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'btrfsck.c') diff --git a/btrfsck.c b/btrfsck.c index 63e44d1d..e3cd4354 100644 --- a/btrfsck.c +++ b/btrfsck.c @@ -1037,7 +1037,7 @@ static int process_one_leaf(struct btrfs_root *root, struct extent_buffer *eb, break; }; } - return 0; + return ret; } static void reada_walk_down(struct btrfs_root *root, @@ -1917,7 +1917,6 @@ static int check_owner_ref(struct btrfs_root *root, struct btrfs_root *ref_root; struct btrfs_key key; struct btrfs_path path; - int ret; int level; int found = 0; @@ -1950,7 +1949,7 @@ static int check_owner_ref(struct btrfs_root *root, btrfs_init_path(&path); path.lowest_level = level + 1; - ret = btrfs_search_slot(NULL, ref_root, &key, &path, 0, 0); + btrfs_search_slot(NULL, ref_root, &key, &path, 0, 0); if (buf->start == btrfs_node_blockptr(path.nodes[level + 1], path.slots[level + 1])) @@ -2539,16 +2538,6 @@ static int run_next_block(struct btrfs_root *root, continue; } if (key.type == BTRFS_BLOCK_GROUP_ITEM_KEY) { - struct btrfs_block_group_item *bi; - bi = btrfs_item_ptr(buf, i, - struct btrfs_block_group_item); -#if 0 - fprintf(stderr,"block group %Lu %Lu used %Lu ", - btrfs_disk_key_objectid(disk_key), - btrfs_disk_key_offset(disk_key), - btrfs_block_group_used(bi)); - fprintf(stderr, "flags %x\n", bi->flags); -#endif continue; } if (key.type == BTRFS_EXTENT_REF_V0_KEY) { -- cgit v1.2.3