From patchwork Thu Jan 26 09:20:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 9538611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8BE176046A for ; Thu, 26 Jan 2017 09:21:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A2C626E69 for ; Thu, 26 Jan 2017 09:21:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EE5E27F8F; Thu, 26 Jan 2017 09:21:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2BF026E69 for ; Thu, 26 Jan 2017 09:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171AbdAZJVK (ORCPT ); Thu, 26 Jan 2017 04:21:10 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:16866 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752935AbdAZJVJ (ORCPT ); Thu, 26 Jan 2017 04:21:09 -0500 X-IronPort-AV: E=Sophos;i="5.33,288,1477954800"; d="scan'208";a="210985022" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jan 2017 10:21:06 +0100 Date: Thu, 26 Jan 2017 10:20:58 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: "Darrick J. Wong" cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, kbuild-all@01.org Subject: [PATCH] xfs: fix returnvar.cocci warnings Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove unneeded variable used to store return value. Generated by: scripts/coccinelle/misc/returnvar.cocci Signed-off-by: Fengguang Wu --- Is it correct to be returning 0 in the level == 0 case? dabtree.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/fs/xfs/scrub/dabtree.c +++ b/fs/xfs/scrub/dabtree.c @@ -96,7 +96,6 @@ xfs_scrub_da_btree_hash( struct xfs_da_node_entry *btree; xfs_dahash_t hash; xfs_dahash_t parent_hash; - int error = 0; /* Is this hash in order? */ hash = be32_to_cpu(*hashp); @@ -104,7 +103,7 @@ xfs_scrub_da_btree_hash( ds->hashes[level] = hash; if (level == 0) - return error; + return 0; /* Is this hash no larger than the parent hash? */ blks = ds->state->path.blk; @@ -112,7 +111,7 @@ xfs_scrub_da_btree_hash( parent_hash = be32_to_cpu(btree->hashval); XFS_SCRUB_DA_CHECK(ds, hash <= parent_hash); - return error; + return 0; } /* Scrub a da btree pointer. */ @@ -122,12 +121,10 @@ xfs_scrub_da_btree_ptr( int level, xfs_dablk_t blkno) { - int error = 0; - XFS_SCRUB_DA_CHECK(ds, blkno >= ds->lowest); XFS_SCRUB_DA_CHECK(ds, ds->highest == 0 || blkno < ds->highest); - return error; + return 0; } /*