erofs: remove unnecessary goto

Message ID 20230615034539.14286-1-frank.li@vivo.com
State New
Headers
Series erofs: remove unnecessary goto |

Commit Message

李扬韬 June 15, 2023, 3:45 a.m. UTC
  It's redundant, let's remove it.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/erofs/super.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
  

Comments

Gao Xiang June 15, 2023, 4:01 a.m. UTC | #1
On 2023/6/15 11:45, Yangtao Li wrote:
> It's redundant, let's remove it.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Thanks,
Gao Xiang
  
Jingbo Xu June 15, 2023, 4:20 a.m. UTC | #2
On 6/15/23 11:45 AM, Yangtao Li wrote:
> It's redundant, let's remove it.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Jingbo Xu <jefflexu@linux.alibaba.com>


> ---
>  fs/erofs/super.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/erofs/super.c b/fs/erofs/super.c
> index 811ab66d805e..f48ce692094d 100644
> --- a/fs/erofs/super.c
> +++ b/fs/erofs/super.c
> @@ -1016,10 +1016,8 @@ static int __init erofs_module_init(void)
>  					       sizeof(struct erofs_inode), 0,
>  					       SLAB_RECLAIM_ACCOUNT,
>  					       erofs_inode_init_once);
> -	if (!erofs_inode_cachep) {
> -		err = -ENOMEM;
> -		goto icache_err;
> -	}
> +	if (!erofs_inode_cachep)
> +		return -ENOMEM;
>  
>  	err = erofs_init_shrinker();
>  	if (err)
> @@ -1054,7 +1052,6 @@ static int __init erofs_module_init(void)
>  	erofs_exit_shrinker();
>  shrinker_err:
>  	kmem_cache_destroy(erofs_inode_cachep);
> -icache_err:
>  	return err;
>  }
>
  

Patch

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 811ab66d805e..f48ce692094d 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -1016,10 +1016,8 @@  static int __init erofs_module_init(void)
 					       sizeof(struct erofs_inode), 0,
 					       SLAB_RECLAIM_ACCOUNT,
 					       erofs_inode_init_once);
-	if (!erofs_inode_cachep) {
-		err = -ENOMEM;
-		goto icache_err;
-	}
+	if (!erofs_inode_cachep)
+		return -ENOMEM;
 
 	err = erofs_init_shrinker();
 	if (err)
@@ -1054,7 +1052,6 @@  static int __init erofs_module_init(void)
 	erofs_exit_shrinker();
 shrinker_err:
 	kmem_cache_destroy(erofs_inode_cachep);
-icache_err:
 	return err;
 }