[PATCH v2] erofs: remove dead code in erofs_fc_parse_param

Chen Linxuan posted 1 patch 1 year ago
fs/erofs/super.c | 2 --
1 file changed, 2 deletions(-)
[PATCH v2] erofs: remove dead code in erofs_fc_parse_param
Posted by Chen Linxuan 1 year ago
If an option is unknown to erofs, which means that option is not in
`erofs_fs_parameters`, `fs_parse` will return -ENOPARAM, which makes
`erofs_fc_parse_param` returns earlier.

Signed-off-by: Chen Linxuan <chenlinxuan@uniontech.com>
---
Change Log:
v1->v2: Improve "erofs: add error log in erofs_fc_parse_param"
---
 fs/erofs/super.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 1fc5623c3a4d..827b62665649 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -508,8 +508,6 @@ static int erofs_fc_parse_param(struct fs_context *fc,
 		errorfc(fc, "%s option not supported", erofs_fs_parameters[opt].name);
 #endif
 		break;
-	default:
-		return -ENOPARAM;
 	}
 	return 0;
 }
-- 
2.43.0
Re: [PATCH v2] erofs: remove dead code in erofs_fc_parse_param
Posted by Gao Xiang 1 year ago

On 2025/1/17 18:06, Chen Linxuan wrote:
> If an option is unknown to erofs, which means that option is not in
> `erofs_fs_parameters`, `fs_parse` will return -ENOPARAM, which makes
> `erofs_fc_parse_param` returns earlier.
> 
> Signed-off-by: Chen Linxuan <chenlinxuan@uniontech.com>

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

Thanks,
Gao Xiang