Patchwork [1/3] ext4: remove 'error' variable in ext4_xattr_check_block()

login
register
mail settings
Submitter Zheng Liu
Date Nov. 7, 2011, 1:32 p.m.
Message ID <1320672724-4432-2-git-send-email-wenqing.lz@taobao.com>
Download mbox | patch
Permalink /patch/124074/
State Accepted
Headers show

Comments

Zheng Liu - Nov. 7, 2011, 1:32 p.m.
From: Zheng Liu <wenqing.lz@taobao.com>

We could return directly from ext4_xattr_check_block(). Thus, we shouldn't
need to define a 'error' variable.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 fs/ext4/xattr.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
Theodore Ts'o - Feb. 13, 2012, 11:04 p.m.
On Mon, Nov 07, 2011 at 09:32:02PM +0800, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
> 
> We could return directly from ext4_xattr_check_block(). Thus, we shouldn't
> need to define a 'error' variable.
> 
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>

Thanks, applied.

					- Ted
--
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

Patch

diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 93a00d8..1bff752 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -158,13 +158,10 @@  ext4_xattr_check_names(struct ext4_xattr_entry *entry, void *end)
 static inline int
 ext4_xattr_check_block(struct buffer_head *bh)
 {
-	int error;
-
 	if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) ||
 	    BHDR(bh)->h_blocks != cpu_to_le32(1))
 		return -EIO;
-	error = ext4_xattr_check_names(BFIRST(bh), bh->b_data + bh->b_size);
-	return error;
+	return ext4_xattr_check_names(BFIRST(bh), bh->b_data + bh->b_size);
 }
 
 static inline int