From patchwork Mon Nov 7 13:32:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Liu X-Patchwork-Id: 124074 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 6B88D1007D3 for ; Tue, 8 Nov 2011 00:30:40 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755552Ab1KGNaj (ORCPT ); Mon, 7 Nov 2011 08:30:39 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:61119 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754691Ab1KGNaj (ORCPT ); Mon, 7 Nov 2011 08:30:39 -0500 Received: by iage36 with SMTP id e36so5838947iag.19 for ; Mon, 07 Nov 2011 05:30:38 -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:in-reply-to:references; bh=iOOuX6c9jo7LqpdHs8Gk1kWQS2UPZhqP7zsd828w+0U=; b=rH5vhqPV6X5c/UkJ+j8AW2yqUjC00pXy5lKyj0CiLLyveVa9gqSwICDJT7uzTC9szV ssjkH6AygDHUi8JPNxd2uaILdCTMKHN7Pb/GWOFFxSelrM8BOW5BWBo4C+n07ECWv/OM +rd5f7aHApyRXv9dH4D5aqueRxnPRYnD4wMdM= Received: by 10.231.83.211 with SMTP id g19mr4951646ibl.26.1320672638647; Mon, 07 Nov 2011 05:30:38 -0800 (PST) Received: from localhost.localdomain ([182.92.247.2]) by mx.google.com with ESMTPS id z10sm38206559ibv.9.2011.11.07.05.30.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Nov 2011 05:30:38 -0800 (PST) From: Zheng Liu To: linux-ext4@vger.kernel.org Cc: Zheng Liu Subject: [PATCH 1/3] ext4: remove 'error' variable in ext4_xattr_check_block() Date: Mon, 7 Nov 2011 21:32:02 +0800 Message-Id: <1320672724-4432-2-git-send-email-wenqing.lz@taobao.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1320672724-4432-1-git-send-email-wenqing.lz@taobao.com> References: <1320672724-4432-1-git-send-email-wenqing.lz@taobao.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Zheng Liu We could return directly from ext4_xattr_check_block(). Thus, we shouldn't need to define a 'error' variable. 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