Messages in this thread Patch in this message | | | From | Chen Zhongjin <> | Subject | [PATCH -next] afs: Remove unused loop code 'nr_servers' | Date | Fri, 30 Sep 2022 18:36:28 +0800 |
| |
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
| |