mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Kleikamp <dave.kleikamp@oracle.com>
To: Yang Li <yang.lee@linux.alibaba.com>
Cc: jfs-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [Jfs-discussion] [PATCH v2] jfs: turn diLog(), dataLog() and txLog() into void functions
Date: Mon, 8 Feb 2021 09:12:28 -0600	[thread overview]
Message-ID: <bc8a4bd6-110d-2ccf-709a-f230f018eca2@oracle.com> (raw)
In-Reply-To: <d8c873e6-d6f5-22b2-43ac-207fb7a1fd07@oracle.com>

I just realized I mangled some whitespace trying to mail this through
Thunderbird. I'll repost it the right way.

Shaggy

On 2/8/21 9:05 AM, Dave Kleikamp wrote:
> On 2/7/21 2:32 AM, Yang Li wrote:
>> 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>
>> ---
>>
>> Changes in v2
>> -turn functions forward references to void type.
>>
>>   fs/jfs/jfs_txnmgr.c | 32 +++++++++++++++-----------------
>>   1 file changed, 15 insertions(+), 17 deletions(-)
> 
> This patch missed fixing a call to txLog() which did check the return 
> value. I took the liberty of fixing it here.
> 
> 
> jfs: turn diLog(), dataLog() and txLog() into void functions
> 
> 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>
> ---
>   fs/jfs/jfs_txnmgr.c | 35 ++++++++++++++++-------------------
>   1 file changed, 16 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
> index dca8edd2378c..053295cd7bc6 100644
> --- a/fs/jfs/jfs_txnmgr.c
> +++ b/fs/jfs/jfs_txnmgr.c
> @@ -148,10 +148,10 @@ 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,
> @@ -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;
> @@ -1414,7 +1412,7 @@ static int txLog(struct jfs_log * log, struct 
> tblock * tblk, struct commit * cd)
>           }
>       }
>   -    return rc;
> +    return;
>   }
>    /*
> @@ -1422,10 +1420,9 @@ static int txLog(struct jfs_log * log, struct 
> tblock * tblk, struct commit * cd)
>    *
>    * 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;
> @@ -1527,7 +1524,7 @@ static int diLog(struct jfs_log * log, struct 
> tblock * tblk, struct lrd * lrd,
>       }
>   #endif                /* _JFS_WIP */
>   -    return rc;
> +    return;
>   }
>    /*
> @@ -1535,8 +1532,8 @@ static int diLog(struct jfs_log * log, struct 
> tblock * tblk, struct lrd * lrd,
>    *
>    * 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;
> @@ -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);
> @@ -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;
>   }
>    /*

      reply	other threads:[~2021-02-08 16:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07  8:32 Yang Li
2021-02-07 10:16 ` kernel test robot
2021-02-07 12:06 ` kernel test robot
2021-02-08 15:05 ` Dave Kleikamp
2021-02-08 15:12   ` Dave Kleikamp [this message]

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=bc8a4bd6-110d-2ccf-709a-f230f018eca2@oracle.com \
    --to=dave.kleikamp@oracle.com \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yang.lee@linux.alibaba.com \
    /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®