Skip to contentSkip to conversation

bcache: remove redundant assignment to variable cur_idx

PATCH In review Colin Ian King 2 participants 2 messages Jul 25, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bcache: remove redundant assignment to variable cur_idx

Variable cur_idx is being initialized with a value that is never read, it is being re-assigned later in a while-loop. Remove the redundant assignment. Cleans up clang scan build warning:

drivers/md/bcache/writeback.c:916:2: warning: Value stored to 'cur_idx' is never read [deadcode.DeadStores]

---
 drivers/md/bcache/writeback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/writeback.c +1 -1
index 24c049067f61..c3e872e0a6f2 100644
@@ -913,7 +913,7 @@ static int bch_dirty_init_thread(void *arg)
 	int cur_idx, prev_idx, skip_nr;
 
 	k = p = NULL;
-	cur_idx = prev_idx = 0;
+	prev_idx = 0;
 
 	bch_btree_iter_init(&c->root->keys, &iter, NULL);
 	k = bch_btree_iter_next_filter(&iter, &c->root->keys, bch_ptr_bad);
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines

2023年7月25日 19:46,Colin Ian King <[email protected]> 写道:

Quoted 8 lines

Variable cur_idx is being initialized with a value that is never read, it is being re-assigned later in a while-loop. Remove the redundant assignment. Cleans up clang scan build warning:

drivers/md/bcache/writeback.c:916:2: warning: Value stored to 'cur_idx' is never read [deadcode.DeadStores]

Looks good to me. Thanks.

Coly Li

Quoted 20 lines

---
drivers/md/bcache/writeback.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/writeback.c +1 -1
index 24c049067f61..c3e872e0a6f2 100644
@@ -913,7 +913,7 @@ static int bch_dirty_init_thread(void *arg)
 int cur_idx, prev_idx, skip_nr;
 
 k = p = NULL;
- cur_idx = prev_idx = 0;
+ prev_idx = 0;
 
 bch_btree_iter_init(&c->root->keys, &iter, NULL);
 k = bch_btree_iter_next_filter(&iter, &c->root->keys, bch_ptr_bad);
Signature · 1 line
2.39.2