[PATCH -next] afs: Remove unused loop code 'nr_servers'

Chen Zhongjin posted 1 patch 2 months ago
fs/afs/volume.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
[PATCH -next] afs: Remove unused loop code 'nr_servers'
Posted by Chen Zhongjin 2 months ago
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.

Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
---
 fs/afs/volume.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/fs/afs/volume.c b/fs/afs/volume.c
index f4937029dcd7..29d483c80281 100644
--- a/fs/afs/volume.c
+++ b/fs/afs/volume.c
@@ -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)
-- 
2.17.1