mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhihao Cheng <chengzhihao1@huawei.com>
To: Shen Lichuan <shenlichuan@vivo.com>, <richard@nod.at>
Cc: <linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	<opensource.kernel@vivo.com>
Subject: Re: [PATCH v1] ubifs: Convert to use ERR_CAST()
Date: Wed, 28 Aug 2024 17:11:37 +0800	[thread overview]
Message-ID: <30abe7aa-ce3a-782b-b4d4-b2177040ed6b@huawei.com> (raw)
In-Reply-To: <20240828085908.35695-1-shenlichuan@vivo.com>

在 2024/8/28 16:59, Shen Lichuan 写道:
> As opposed to open-code, using the ERR_CAST macro clearly indicates that
> this is a pointer to an error value and a type conversion was performed.
> 
> Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
> ---
>   fs/ubifs/lpt_commit.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
> diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c
> index 07351fdce722..aa8837e6247c 100644
> --- a/fs/ubifs/lpt_commit.c
> +++ b/fs/ubifs/lpt_commit.c
> @@ -577,7 +577,7 @@ static struct ubifs_pnode *next_pnode_to_dirty(struct ubifs_info *c,
>   	/* Go right */
>   	nnode = ubifs_get_nnode(c, nnode, iip);
>   	if (IS_ERR(nnode))
> -		return (void *)nnode;
> +		return ERR_CAST(nnode);
>   
>   	/* Go down to level 1 */
>   	while (nnode->level > 1) {
> @@ -594,7 +594,7 @@ static struct ubifs_pnode *next_pnode_to_dirty(struct ubifs_info *c,
>   		}
>   		nnode = ubifs_get_nnode(c, nnode, iip);
>   		if (IS_ERR(nnode))
> -			return (void *)nnode;
> +			return ERR_CAST(nnode);
>   	}
>   
>   	for (iip = 0; iip < UBIFS_LPT_FANOUT; iip++)
> 


      reply	other threads:[~2024-08-28  9:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28  8:59 Shen Lichuan
2024-08-28  9:11 ` Zhihao Cheng [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=30abe7aa-ce3a-782b-b4d4-b2177040ed6b@huawei.com \
    --to=chengzhihao1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=opensource.kernel@vivo.com \
    --cc=richard@nod.at \
    --cc=shenlichuan@vivo.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®