Skip to contentSkip to conversation

bcache: remove set but not used variable 'i'

PATCH In review Wang Hai 2 participants 3 messages Apr 6, 2020 bcache (block layer cache)

lore
Share & tools
lore

Wang Hai

author
#0 lore raw

PATCH 1/1 bcache: remove set but not used variable 'i'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/md/bcache/btree.c: In function bch_btree_check_thread:
drivers/md/bcache/btree.c:1910:6: warning:
variable ‘i’ set but not used [-Wunused-but-set-variable]

It's not used since commit 8e7102273f59 ("bcache: make bch_btree_check() to be multithreaded"), so remove it.

---
 drivers/md/bcache/btree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/bcache/btree.c +2 -2
index 72856e5..b962313 100644
@@ -1907,10 +1907,10 @@ static int bch_btree_check_thread(void *arg)
 	struct btree_iter iter;
 	struct bkey *k, *p;
 	int cur_idx, prev_idx, skip_nr;
-	int i, n;
+	int n;
 
 	k = p = NULL;
-	i = n = 0;
+	n = 0;
 	cur_idx = prev_idx = 0;
 	ret = 0;
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 11 lines · Wang Hai

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/md/bcache/btree.c: In function bch_btree_check_thread:
drivers/md/bcache/btree.c:1910:6: warning:
variable ‘i’ set but not used [-Wunused-but-set-variable]

It's not used since commit 8e7102273f59 ("bcache: make bch_btree_check() to be multithreaded"), so remove it.

Hi Hai,

Colin King already submitted a similar patch on Apr 2 to fix it.

Thanks.

Coly Li

Quoted 22 lines
---
 drivers/md/bcache/btree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/bcache/btree.c +2 -2
index 72856e5..b962313 100644
@@ -1907,10 +1907,10 @@ static int bch_btree_check_thread(void *arg)
 	struct btree_iter iter;
 	struct bkey *k, *p;
 	int cur_idx, prev_idx, skip_nr;
-	int i, n;
+	int n;
 
 	k = p = NULL;
-	i = n = 0;
+	n = 0;
 	cur_idx = prev_idx = 0;
 	ret = 0;
 
#2 lore raw
Quoted 12 lines · Coly Li
Quoted 11 lines · Wang Hai

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/md/bcache/btree.c: In function bch_btree_check_thread:
drivers/md/bcache/btree.c:1910:6: warning:
variable ‘i’ set but not used [-Wunused-but-set-variable]

It's not used since commit 8e7102273f59 ("bcache: make bch_btree_check() to be multithreaded"), so remove it.

Quoted 7 lines

Hi Hai,

Colin King already submitted a similar patch on Apr 2 to fix it.

Thanks.

Coly Li

Thanks for reminding, please ignore this patch.