Skip to contentSkip to conversation

afs: Remove unused loop code 'nr_servers'

PATCH New Chen Zhongjin 1 participant 1 message Sep 30, 2022 Afs filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 afs: Remove unused loop code 'nr_servers'

Reported by Clang [-Wunused-but-set-variable]

'commit 45df8462730d ("afs: Fix server list handling")' This commit deleted all the logic about searching records in servers, but the loop to count 'nr_servers' was not dropped together.

Since these code should have been part of deleted code, and also there is no other code referencing them, remove them for code cleaning.

---
 fs/afs/volume.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
fs/afs/volume.c +1 -5
index f4937029dcd7..29d483c80281 100644
@@ -70,11 +70,7 @@ static struct afs_volume *afs_alloc_volume(struct afs_fs_context *params,
 {
 	struct afs_server_list *slist;
 	struct afs_volume *volume;
-	int ret = -ENOMEM, nr_servers = 0, i;
-
-	for (i = 0; i < vldb->nr_servers; i++)
-		if (vldb->fs_mask[i] & type_mask)
-			nr_servers++;
+	int ret = -ENOMEM;
 
 	volume = kzalloc(sizeof(struct afs_volume), GFP_KERNEL);
 	if (!volume)
Signature · 1 line
2.17.1