* [PATCH v1] ubifs: Convert to use ERR_CAST()
@ 2024-08-28 8:59 Shen Lichuan
2024-08-28 9:11 ` Zhihao Cheng
0 siblings, 1 reply; 2+ messages in thread
From: Shen Lichuan @ 2024-08-28 8:59 UTC (permalink / raw)
To: richard
Cc: linux-mtd, linux-kernel, chengzhihao1, opensource.kernel, 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(-)
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++)
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v1] ubifs: Convert to use ERR_CAST()
2024-08-28 8:59 [PATCH v1] ubifs: Convert to use ERR_CAST() Shen Lichuan
@ 2024-08-28 9:11 ` Zhihao Cheng
0 siblings, 0 replies; 2+ messages in thread
From: Zhihao Cheng @ 2024-08-28 9:11 UTC (permalink / raw)
To: Shen Lichuan, richard; +Cc: linux-mtd, linux-kernel, opensource.kernel
在 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++)
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-28 9:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-28 8:59 [PATCH v1] ubifs: Convert to use ERR_CAST() Shen Lichuan
2024-08-28 9:11 ` Zhihao Cheng
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®