All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] f2fs: remove redundant assignment to variable err
@ 2025-03-19 11:30 Colin Ian King
  2025-03-19 12:09 ` Chao Yu
  2025-03-19 12:31 ` Dan Carpenter
  0 siblings, 2 replies; 6+ messages in thread
From: Colin Ian King @ 2025-03-19 11:30 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu, linux-f2fs-devel; +Cc: kernel-janitors, linux-kernel

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.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/f2fs/node.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 5f15c224bf78..37c76bb19a8c 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -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;
 	}
 
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH][next] f2fs: remove redundant assignment to variable err
@ 2023-06-16 14:20 Colin Ian King
  0 siblings, 0 replies; 6+ messages in thread
From: Colin Ian King @ 2023-06-16 14:20 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu, linux-f2fs-devel; +Cc: kernel-janitors, linux-kernel

The assignment to variable err is redundant since the code jumps to
label next and err is then re-assigned a new value on the call to
sanity_check_node_chain. Remove the assignment.

Cleans up clang scan build warning:
fs/f2fs/recovery.c:464:6: warning: Value stored to 'err' is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/f2fs/recovery.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index f0cf1538389c..4e7d4ceeb084 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -460,10 +460,8 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head,
 								quota_inode);
 			if (IS_ERR(entry)) {
 				err = PTR_ERR(entry);
-				if (err == -ENOENT) {
-					err = 0;
+				if (err == -ENOENT)
 					goto next;
-				}
 				f2fs_put_page(page, 1);
 				break;
 			}
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-03-20  2:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-19 11:30 [PATCH][next] f2fs: remove redundant assignment to variable err Colin Ian King
2025-03-19 12:09 ` Chao Yu
2025-03-19 12:31 ` Dan Carpenter
2025-03-20  2:26   ` Jaegeuk Kim
2025-03-20  2:26     ` [f2fs-dev] " Jaegeuk Kim via Linux-f2fs-devel
  -- strict thread matches above, loose matches on Subject: below --
2023-06-16 14:20 Colin Ian King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.