[PATCH] affs: fix shadowed variable sparse warnings

From: Harvey Harrison
Date: Fri Feb 08 2008 - 21:53:55 EST


Introduce _tmp in the small if-blocks where this is shadowed.
fs/affs/file.c:573:8: warning: symbol 'tmp' shadows an earlier one
fs/affs/file.c:530:6: originally declared here
fs/affs/file.c:714:9: warning: symbol 'tmp' shadows an earlier one
fs/affs/file.c:661:6: originally declared here
fs/affs/file.c:746:9: warning: symbol 'tmp' shadows an earlier one
fs/affs/file.c:661:6: originally declared here

Remove declaration and assign to original variable as we are going
to return from the function at this point anyway.
fs/affs/file.c:831:7: warning: symbol 'size' shadows an earlier one
fs/affs/file.c:813:6: originally declared here

Signed-off-by: Harvey Harrison <harvey.harrison@xxxxxxxxx>
---
Roman, any interest?

fs/affs/file.c | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/fs/affs/file.c b/fs/affs/file.c
index 6e0c939..ac05dc2 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -570,11 +570,11 @@ affs_extent_file_ofs(struct inode *inode, u32 newsize)
bh->b_state &= ~(1UL << BH_New);
mark_buffer_dirty_inode(bh, inode);
if (prev_bh) {
- u32 tmp = be32_to_cpu(AFFS_DATA_HEAD(prev_bh)->next);
- if (tmp)
- affs_warning(sb, "extent_file_ofs", "next block already set for %d (%d)", bidx, tmp);
+ u32 _tmp = be32_to_cpu(AFFS_DATA_HEAD(prev_bh)->next);
+ if (_tmp)
+ affs_warning(sb, "extent_file_ofs", "next block already set for %d (%d)", bidx, _tmp);
AFFS_DATA_HEAD(prev_bh)->next = cpu_to_be32(bh->b_blocknr);
- affs_adjust_checksum(prev_bh, bh->b_blocknr - tmp);
+ affs_adjust_checksum(prev_bh, bh->b_blocknr - _tmp);
mark_buffer_dirty_inode(prev_bh, inode);
affs_brelse(prev_bh);
}
@@ -711,11 +711,11 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping,
AFFS_DATA_HEAD(bh)->next = 0;
bh->b_state &= ~(1UL << BH_New);
if (prev_bh) {
- u32 tmp = be32_to_cpu(AFFS_DATA_HEAD(prev_bh)->next);
- if (tmp)
- affs_warning(sb, "commit_write_ofs", "next block already set for %d (%d)", bidx, tmp);
+ u32 _tmp = be32_to_cpu(AFFS_DATA_HEAD(prev_bh)->next);
+ if (_tmp)
+ affs_warning(sb, "commit_write_ofs", "next block already set for %d (%d)", bidx, _tmp);
AFFS_DATA_HEAD(prev_bh)->next = cpu_to_be32(bh->b_blocknr);
- affs_adjust_checksum(prev_bh, bh->b_blocknr - tmp);
+ affs_adjust_checksum(prev_bh, bh->b_blocknr - _tmp);
mark_buffer_dirty_inode(prev_bh, inode);
}
}
@@ -743,11 +743,11 @@ static int affs_write_end_ofs(struct file *file, struct address_space *mapping,
AFFS_DATA_HEAD(bh)->next = 0;
bh->b_state &= ~(1UL << BH_New);
if (prev_bh) {
- u32 tmp = be32_to_cpu(AFFS_DATA_HEAD(prev_bh)->next);
- if (tmp)
- affs_warning(sb, "commit_write_ofs", "next block already set for %d (%d)", bidx, tmp);
+ u32 _tmp = be32_to_cpu(AFFS_DATA_HEAD(prev_bh)->next);
+ if (_tmp)
+ affs_warning(sb, "commit_write_ofs", "next block already set for %d (%d)", bidx, _tmp);
AFFS_DATA_HEAD(prev_bh)->next = cpu_to_be32(bh->b_blocknr);
- affs_adjust_checksum(prev_bh, bh->b_blocknr - tmp);
+ affs_adjust_checksum(prev_bh, bh->b_blocknr - _tmp);
mark_buffer_dirty_inode(prev_bh, inode);
}
} else if (be32_to_cpu(AFFS_DATA_HEAD(bh)->size) < tmp)
@@ -828,8 +828,8 @@ affs_truncate(struct inode *inode)
struct address_space *mapping = inode->i_mapping;
struct page *page;
void *fsdata;
- u32 size = inode->i_size;
int res;
+ size = inode->i_size;

res = mapping->a_ops->write_begin(NULL, mapping, size, 0, 0, &page, &fsdata);
if (!res)
--
1.5.4.1219.g65b9



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/