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

From: Chen Zhongjin
Date: Fri Sep 30 2022 - 07:04:23 EST


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@xxxxxxxxxx>
---
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