From patchwork Mon Jan 16 09:16:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Liu X-Patchwork-Id: 136263 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B1200B6EEA for ; Mon, 16 Jan 2012 20:12:35 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753564Ab2APJMd (ORCPT ); Mon, 16 Jan 2012 04:12:33 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:43155 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753509Ab2APJMc (ORCPT ); Mon, 16 Jan 2012 04:12:32 -0500 Received: by iagf6 with SMTP id f6so2275173iag.19 for ; Mon, 16 Jan 2012 01:12:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=ewsJ5W1t++IwL5+PwIICbsD/sHkPEdRkZehI2g1qbdk=; b=OceKsvkyfKMfUKpEcM8Vcqk4xTCfLDG2l4W24egAJoPZpQssYrmp+gWtpLmi43xlwO Ta4JSJXcCdvY3w1KiudHILyRiyBRXtmwkq2m4/d45/7dIwO9OENqAxU+KHJX/UiiPNJf cfAsJL3dD7VQ9ciLdnTlGQUkXuuMEJgdmsIYk= Received: by 10.42.135.138 with SMTP id p10mr9746545ict.25.1326705152459; Mon, 16 Jan 2012 01:12:32 -0800 (PST) Received: from localhost.localdomain ([182.92.247.2]) by mx.google.com with ESMTPS id gh7sm32178712igb.1.2012.01.16.01.12.29 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jan 2012 01:12:31 -0800 (PST) From: Zheng Liu To: linux-ext4@vger.kernel.org Cc: Zheng Liu , "Theodore Ts'o" Subject: [PATCH RESEND] ext4: remove 'error' variable in ext4_xattr_check_block() function Date: Mon, 16 Jan 2012 17:16:13 +0800 Message-Id: <1326705373-4659-1-git-send-email-wenqing.lz@taobao.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org We can return from ext4_xattr_check_block() directly. Thus, we don't need to define a 'error' variable. CC: "Theodore Ts'o" Signed-off-by: Zheng Liu --- fs/ext4/xattr.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) 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