lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1701261019430.3109@hadrien>
Date:   Thu, 26 Jan 2017 10:20:58 +0100 (CET)
From:   Julia Lawall <julia.lawall@...6.fr>
To:     "Darrick J. Wong" <darrick.wong@...cle.com>
cc:     linux-xfs@...r.kernel.org, linux-kernel@...r.kernel.org,
        kbuild-all@...org
Subject: [PATCH] xfs: fix returnvar.cocci warnings

Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
---

Is it correct to be returning 0 in the level == 0 case?

 dabtree.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- 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;
 }

 /*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ