f2fs: remove redundant assignment to variable err
Subsystems (2)
PATCH 1/1 f2fs: remove redundant assignment to variable err
The variable err is being assigned a value zero and then the following goto page_hit reassigns err a new value. The zero assignment is redundant and can be removed.
--- fs/f2fs/node.c | 1 - 1 file changed, 1 deletion(-)
fs/f2fs/node.c +0 -1
@@ -1497,7 +1497,6 @@ static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid,if (err <0 ) { goto out_put_err; }else if (err ==LOCKED_PAGE ) { - err =0 ; goto page_hit; }
Signature · 1 line
2.49.0
Quoted 5 lines · Colin Ian King
The variable err is being assigned a value zero and then the following goto
page_hitreassigns err a new value. The zero assignment is redundant and can be removed.Signed-off-by Colin Ian King <[email protected]>
Thanks,
Quoted 14 lines · Colin Ian King
The variable err is being assigned a value zero and then the following goto
page_hitreassigns err a new value. The zero assignment is redundant and can be removed.Signed-off-by Colin Ian King <[email protected]>--- fs/f2fs/node.c | 1 - 1 file changed, 1 deletion(-)fs/f2fs/node.c +0
-0
fs/f2fs/node.c static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid, · line 1501
Quoted 6 lines
fs/f2fs/node.c +0
-1@@ -1497,7 +1497,6 @@ static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid,if (err <0 ) { goto out_put_err; }else if (err ==LOCKED_PAGE ) { - err =0 ; goto page_hit; }
We could remove the curly braces as well.
regards,
dan carpenter
Quoted 10 lines · Dan Carpenter
Quoted 9 lines · Colin Ian King
The variable err is being assigned a value zero and then the following goto
page_hitreassigns err a new value. The zero assignment is redundant and can be removed.Signed-off-by Colin Ian King <[email protected]>--- fs/f2fs/node.c | 1 - 1 file changed, 1 deletion(-)
Quoted 13 lines
fs/f2fs/node.c static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid, · line 1501
Quoted 11 lines
fs/f2fs/node.c +0
-1@@ -1497,7 +1497,6 @@ static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid,if (err <0 ) { goto out_put_err; }else if (err ==LOCKED_PAGE ) { - err =0 ; goto page_hit; }We could remove the curly braces as well.
Applied as below. Thanks.
@@ -1494,12 +1494,10 @@ static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid,
return folio;
err = read_node_page(&folio->page, 0);
- if (err < 0) {
+ if (err < 0)
goto out_put_err;
- } else if (err == LOCKED_PAGE) {
- err = 0;
+ if (err == LOCKED_PAGE)
goto page_hit;- }
if (parent)
f2fs_ra_node_pages(parent, start + 1, MAX_RA_NODE);Quoted 3 lines
regards,
dan carpenter