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 --- volumes.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'volumes.c') diff --git a/volumes.c b/volumes.c index 5773467a..ccdcb30b 100644 --- a/volumes.c +++ b/volumes.c @@ -643,7 +643,6 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, struct list_head *cur; struct map_lookup *map; int min_stripe_size = 1 * 1024 * 1024; - u64 physical; u64 calc_size = 8 * 1024 * 1024; u64 min_free; u64 max_chunk_size = 4 * calc_size; @@ -811,7 +810,6 @@ again: btrfs_set_stack_stripe_devid(stripe, device->devid); btrfs_set_stack_stripe_offset(stripe, dev_offset); memcpy(stripe->dev_uuid, device->uuid, BTRFS_UUID_SIZE); - physical = dev_offset; index++; } BUG_ON(!list_empty(&private_devs)); @@ -971,14 +969,12 @@ int btrfs_num_copies(struct btrfs_mapping_tree *map_tree, u64 logical, u64 len) struct cache_extent *ce; struct map_lookup *map; int ret; - u64 offset; ce = find_first_cache_extent(&map_tree->cache_tree, logical); BUG_ON(!ce); BUG_ON(ce->start > logical || ce->start + ce->size < logical); map = container_of(ce, struct map_lookup, ce); - offset = logical - ce->start; if (map->type & (BTRFS_BLOCK_GROUP_DUP | BTRFS_BLOCK_GROUP_RAID1)) ret = map->num_stripes; else if (map->type & BTRFS_BLOCK_GROUP_RAID10) -- cgit v1.2.3