]> git.hungrycats.org Git - linux/commitdiff
btrfs: remove shadowing variables in __btrfs_map_block
authorDavid Sterba <dsterba@suse.cz>
Tue, 24 Feb 2015 18:45:15 +0000 (19:45 +0100)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Wed, 22 Apr 2015 16:24:57 +0000 (12:24 -0400)
1) We can safely use the function's 'i'. Fixes warning

fs/btrfs/volumes.c:5257:7: warning: declaration of 'i' shadows a previous local
fs/btrfs/volumes.c:4951:6: warning: shadowed declaration is here

2) A local variable duplicates name of an argument, we can use the value
directly. Fixes warning

fs/btrfs/volumes.c:5433:8: warning: declaration of 'length' shadows a parameter
fs/btrfs/volumes.c:4935:27: warning: shadowed declaration is here

Signed-off-by: David Sterba <dsterba@suse.cz>
(cherry picked from commit 258ece02126a67af263746e1ae5f8ddf0d492e14)

fs/btrfs/volumes.c

index fb0e65256d752a5f153bd8fa251d70079509eedc..a73acf496e10fe798a1594cafbb5660736460f81 100644 (file)
@@ -5253,7 +5253,6 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
            need_raid_map && ((rw & (REQ_WRITE | REQ_GET_READ_MIRRORS)) ||
            mirror_num > 1)) {
                u64 tmp;
-               int i;
                unsigned rot;
 
                bbio->raid_map = (u64 *)((void *)bbio->stripes +
@@ -5429,9 +5428,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
                        }
                }
                if (found) {
-                       u64 length = map->stripe_len;
-
-                       if (physical_of_found + length <=
+                       if (physical_of_found + map->stripe_len <=
                            dev_replace->cursor_left) {
                                struct btrfs_bio_stripe *tgtdev_stripe =
                                        bbio->stripes + num_stripes;