Skip to contentSkip to conversation

jfs: Change return type of txLog

PATCH New Hariprasad Kelam 1 participant 1 message Jul 21, 2019 JFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 jfs: Change return type of txLog

As txLog always returns 0 change return type from int to void.

fix below issue reported by coccicheck /fs/jfs/jfs_txnmgr.c:1370:5-7: Unneeded variable: "rc". Return "0" on line 1417

---
 fs/jfs/jfs_txnmgr.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
fs/jfs/jfs_txnmgr.c +4 -8
index c8ce7f1..645cd0a2 100644
@@ -159,8 +159,8 @@ static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
 static void txAllocPMap(struct inode *ip, struct maplock * maplock,
 		struct tblock * tblk);
 static void txForce(struct tblock * tblk);
-static int txLog(struct jfs_log * log, struct tblock * tblk,
-		struct commit * cd);
+static void txLog(struct jfs_log *log, struct tblock *tblk,
+		struct commit *cd);
 static void txUpdateMap(struct tblock * tblk);
 static void txRelease(struct tblock * tblk);
 static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
@@ -1256,8 +1256,7 @@ int txCommit(tid_t tid,		/* transaction identifier */
 	 *
 	 * txUpdateMap() resets XAD_NEW in XAD.
 	 */
-	if ((rc = txLog(log, tblk, &cd)))
-		goto TheEnd;
+	 txLog(log, tblk, &cd);
 
 	/*
 	 * Ensure that inode isn't reused before
@@ -1365,9 +1364,8 @@ int txCommit(tid_t tid,		/* transaction identifier */
  *
  * RETURN :
  */
-static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd)
+static void txLog(struct jfs_log *log, struct tblock *tblk, struct commit *cd)
 {
-	int rc = 0;
 	struct inode *ip;
 	lid_t lid;
 	struct tlock *tlck;
@@ -1413,8 +1411,6 @@ static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd)
 			jfs_err("UFO tlock:0x%p", tlck);
 		}
 	}
-
-	return rc;
 }
 
 /*
Signature · 1 line
2.7.4