Skip to content

Commit

Permalink
mm: remove temporary variable on generic_file_direct_write()
Browse files Browse the repository at this point in the history
'end' shadows earlier one and is not necessary at all.  Remove it and use
'pos' instead.  This removes following sparse warnings:

 mm/filemap.c:2180:24: warning: symbol 'end' shadows an earlier one
 mm/filemap.c:2132:25: originally declared here

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Namhyung Kim authored and Linus Torvalds committed Oct 26, 2010
1 parent 68da336 commit 0116651
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2193,12 +2193,12 @@ generic_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
}

if (written > 0) {
loff_t end = pos + written;
if (end > i_size_read(inode) && !S_ISBLK(inode->i_mode)) {
i_size_write(inode, end);
pos += written;
if (pos > i_size_read(inode) && !S_ISBLK(inode->i_mode)) {
i_size_write(inode, pos);
mark_inode_dirty(inode);
}
*ppos = end;
*ppos = pos;
}
out:
return written;
Expand Down

0 comments on commit 0116651

Please sign in to comment.