All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] bcachefs: remove redundant initialization of variable level
@ 2023-11-11 20:45 Colin Ian King
  2023-11-11 21:02 ` Kent Overstreet
  0 siblings, 1 reply; 7+ messages in thread
From: Colin Ian King @ 2023-11-11 20:45 UTC (permalink / raw)
  To: Kent Overstreet, Brian Foster, linux-bcachefs
  Cc: kernel-janitors, linux-kernel

Variable level is being initialized a value that is never read, the
variable is being re-assigned another value several statements later
on. The initialization is redundant and can be removed. Cleans up
clang scan build warning:

fs/bcachefs/btree_iter.c:1217:11: warning: Value stored to 'level'
during its initialization is never read [deadcode.DeadStores]

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

diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c
index c2adf3fbb0b3..bd04aeda37bb 100644
--- a/fs/bcachefs/btree_iter.c
+++ b/fs/bcachefs/btree_iter.c
@@ -1214,7 +1214,7 @@ __bch2_btree_path_set_pos(struct btree_trans *trans,
 		   struct btree_path *path, struct bpos new_pos,
 		   bool intent, unsigned long ip, int cmp)
 {
-	unsigned level = path->level;
+	unsigned level;
 
 	bch2_trans_verify_not_in_restart(trans);
 	EBUG_ON(!path->ref);
-- 
2.39.2


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

end of thread, other threads:[~2023-11-20 12:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-11 20:45 [PATCH][next] bcachefs: remove redundant initialization of variable level Colin Ian King
2023-11-11 21:02 ` Kent Overstreet
2023-11-11 21:19   ` David Laight
2023-11-11 23:39     ` Kent Overstreet
2023-11-12 18:34       ` David Laight
2023-11-12 19:12         ` Kent Overstreet
2023-11-20 12:00           ` Dan Carpenter

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.