From: David Sterba <dsterba@suse.cz>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.cz>
Subject: [PATCH 10/11] btrfs: remove shadowing variables in __btrfs_map_block
Date: Wed, 25 Feb 2015 19:25:04 +0100 [thread overview]
Message-ID: <789b7da8d9cce6d78b1a4d38a2669aec87af81d7.1424880058.git.dsterba@suse.cz> (raw)
In-Reply-To: <cover.1424880058.git.dsterba@suse.cz>
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>
---
fs/btrfs/volumes.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 11bd47ba6a48..0ac03e4f962a 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -5264,7 +5264,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 +
@@ -5440,9 +5439,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;
--
2.1.3
next prev parent reply other threads:[~2015-02-25 18:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-25 18:24 [PULL] [PATCH 00/11] Cleanups for 4.1 David Sterba
2015-02-25 18:24 ` [PATCH 01/11] btrfs: need_resched not needed with cond_resched David Sterba
2015-02-25 18:24 ` [PATCH 02/11] btrfs: use cond_resched_lock where possible David Sterba
2015-02-25 18:24 ` [PATCH 03/11] btrfs: cleanup 64bit/32bit divs, compile time constants David Sterba
2015-02-25 18:24 ` [PATCH 04/11] btrfs: cleanup 64bit/32bit divs, provably bounded values David Sterba
2015-02-25 18:24 ` [PATCH 05/11] btrfs: replace remaining do_div calls with div_u64 variants David Sterba
2015-02-25 18:24 ` [PATCH 06/11] btrfs: cleanup, use correct type in div_u64_rem David Sterba
2015-02-25 18:24 ` [PATCH 07/11] btrfs: cleanup, use kmalloc_array/kcalloc array helpers David Sterba
2015-02-25 18:24 ` [PATCH 08/11] btrfs: remove shadowing variables in __btrfs_buffered_write David Sterba
2015-02-25 18:25 ` [PATCH 09/11] btrfs: switch helper macros to static inlines in sysfs.h David Sterba
2015-02-25 18:25 ` David Sterba [this message]
2015-02-25 18:25 ` [PATCH 11/11] btrfs: use explicit initializer for seq_elem David Sterba
2015-02-26 1:39 ` [PULL] [PATCH 00/11] Cleanups for 4.1 Zhao Lei
2015-02-26 17:46 ` David Sterba
2015-03-03 16:30 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=789b7da8d9cce6d78b1a4d38a2669aec87af81d7.1424880058.git.dsterba@suse.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).