fs/affs/file.c: fix shadow warnings
authorFabian Frederick <fabf@skynet.be>
Mon, 13 Oct 2014 22:53:54 +0000 (15:53 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 Oct 2014 00:18:22 +0000 (02:18 +0200)
Four functions declared variables twice resulting in shadow warnings.

This patch renames internal variables and adds blank line after
declarations.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/affs/file.c

index a7fe57d2cd9a0aa6a59df2cd90778127ebc2bbc3..1ed590aafecf744884c3e55af7cd9627d1c729f8 100644 (file)
@@ -584,11 +584,14 @@ 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_next = be32_to_cpu(AFFS_DATA_HEAD(prev_bh)->next);
+
+                       if (tmp_next)
+                               affs_warning(sb, "extent_file_ofs",
+                                            "next block already set for %d (%d)",
+                                            bidx, tmp_next);
                        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_next);
                        mark_buffer_dirty_inode(prev_bh, inode);
                        affs_brelse(prev_bh);
                }
@@ -727,11 +730,14 @@ 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_next = be32_to_cpu(AFFS_DATA_HEAD(prev_bh)->next);
+
+                               if (tmp_next)
+                                       affs_warning(sb, "commit_write_ofs",
+                                                    "next block already set for %d (%d)",
+                                                    bidx, tmp_next);
                                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_next);
                                mark_buffer_dirty_inode(prev_bh, inode);
                        }
                }
@@ -758,11 +764,14 @@ 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_next = be32_to_cpu(AFFS_DATA_HEAD(prev_bh)->next);
+
+                               if (tmp_next)
+                                       affs_warning(sb, "commit_write_ofs",
+                                                    "next block already set for %d (%d)",
+                                                    bidx, tmp_next);
                                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_next);
                                mark_buffer_dirty_inode(prev_bh, inode);
                        }
                } else if (be32_to_cpu(AFFS_DATA_HEAD(bh)->size) < tmp)
@@ -842,12 +851,12 @@ affs_truncate(struct inode *inode)
                struct address_space *mapping = inode->i_mapping;
                struct page *page;
                void *fsdata;
-               loff_t size = inode->i_size;
+               loff_t isize = inode->i_size;
                int res;
 
-               res = mapping->a_ops->write_begin(NULL, mapping, size, 0, 0, &page, &fsdata);
+               res = mapping->a_ops->write_begin(NULL, mapping, isize, 0, 0, &page, &fsdata);
                if (!res)
-                       res = mapping->a_ops->write_end(NULL, mapping, size, 0, 0, page, fsdata);
+                       res = mapping->a_ops->write_end(NULL, mapping, isize, 0, 0, page, fsdata);
                else
                        inode->i_size = AFFS_I(inode)->mmu_private;
                mark_inode_dirty(inode);