mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	kbuild-all@01.org
Subject: [PATCH] xfs: fix returnvar.cocci warnings
Date: Thu, 26 Jan 2017 10:20:58 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1701261019430.3109@hadrien> (raw)

Remove unneeded variable used to store return value.

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

Signed-off-by: Fengguang Wu <fengguang.wu@intel.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;
 }

 /*

             reply	other threads:[~2017-01-26  9:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26  9:20 Julia Lawall [this message]
2017-01-26 18:30 ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1701261019430.3109@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=darrick.wong@oracle.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®