linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: deleted unnecessary assignments and useless "if" statement
@ 2013-06-20  5:44 jon ernst
  2013-06-20 14:44 ` Theodore Ts'o
  0 siblings, 1 reply; 6+ messages in thread
From: jon ernst @ 2013-06-20  5:44 UTC (permalink / raw)
  To: linux-ext4

comparing unsigned variable with 0 always return false.
err = 0 is duplicated and unnecessary.

Signed-off-by: "Jon Ernst" <jonernst07@gmx.com>

--- a/fs/ext4/inode.c     
+++ b/fs/ext4/inode.c     
@@ -1098,8 +1098,6 @@ static int ext4_write_end(struct file *f
        if (i_size_changed)
                ext4_mark_inode_dirty(handle, inode);

-       if (copied < 0)
-               ret = copied;
        if (pos + len > inode->i_size && ext4_can_truncate(inode))
                /* if we have allocated more blocks and copied
                 * less. We will have blocks allocated outside
@@ -3365,7 +3363,6 @@ int ext4_block_zero_page_range(handle_t
                pos += blocksize;
        }

-       err = 0;
        if (buffer_freed(bh)) {
                BUFFER_TRACE(bh, "freed: skip");
                goto unlock;
@@ -3405,7 +3402,6 @@ int ext4_block_zero_page_range(handle_t

        BUFFER_TRACE(bh, "zeroed end of block");

-       err = 0;
        if (ext4_should_journal_data(inode)) {
                err = ext4_handle_dirty_metadata(handle, inode, bh);
        } else {
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-24 13:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20  5:44 [PATCH] ext4: deleted unnecessary assignments and useless "if" statement jon ernst
2013-06-20 14:44 ` Theodore Ts'o
2013-06-20 14:52   ` [PATCH] ext4: check error return from ext4_write_inline_data_end() Theodore Ts'o
2013-06-20 19:45     ` [PATCH -v3] ext4: delete unnecessary C statements Theodore Ts'o
2013-06-24 13:52       ` Zheng Liu
2013-06-24 13:40     ` [PATCH] ext4: check error return from ext4_write_inline_data_end() Zheng Liu

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).