Skip to content

Commit

Permalink
jfs: turn diLog(), dataLog() and txLog() into void functions
Browse files Browse the repository at this point in the history
These functions always return '0' and no callers use the return value.
So make it a void function.

This eliminates the following coccicheck warning:
./fs/jfs/jfs_txnmgr.c:1365:5-7: Unneeded variable: "rc". Return "0" on
line 1414
./fs/jfs/jfs_txnmgr.c:1422:5-7: Unneeded variable: "rc". Return "0" on
line 1527

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
  • Loading branch information
Yang Li authored and kleikamp committed Feb 8, 2021
1 parent 3bef198 commit 093e068
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions fs/jfs/jfs_txnmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,19 @@ static struct {
/*
* forward references
*/
static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck, struct commit * cd);
static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck);
static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
struct tlock *tlck, struct commit *cd);
static void dataLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
struct tlock *tlck);
static void dtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck);
static void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck);
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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1414,18 +1412,17 @@ static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd)
}
}

return rc;
return;
}

/*
* diLog()
*
* function: log inode tlock and format maplock to update bmap;
*/
static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck, struct commit * cd)
static void diLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
struct tlock *tlck, struct commit *cd)
{
int rc = 0;
struct metapage *mp;
pxd_t *pxd;
struct pxd_lock *pxdlock;
Expand Down Expand Up @@ -1527,16 +1524,16 @@ static int diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
}
#endif /* _JFS_WIP */

return rc;
return;
}

/*
* dataLog()
*
* function: log data tlock
*/
static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck)
static void dataLog(struct jfs_log *log, struct tblock *tblk, struct lrd *lrd,
struct tlock *tlck)
{
struct metapage *mp;
pxd_t *pxd;
Expand All @@ -1562,7 +1559,7 @@ static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
metapage_homeok(mp);
discard_metapage(mp);
tlck->mp = NULL;
return 0;
return;
}

PXDaddress(pxd, mp->index);
Expand All @@ -1573,7 +1570,7 @@ static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
/* mark page as homeward bound */
tlck->flag |= tlckWRITEPAGE;

return 0;
return;
}

/*
Expand Down

0 comments on commit 093e068

Please sign in to comment.