summaryrefslogtreecommitdiff
path: root/drivers/virt
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-07-04 20:50:44 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-08 15:42:10 +0200
commite5535ff173318775f2c52b7f072bb3abf03b5b0f (patch)
treebbeec04e4de5122934b16bd24f8fcabefaff8965 /drivers/virt
parent64c591661e4948257aac9b586394a25a7c64ec69 (diff)
virt: acrn: using for_each_set_bit to simplify the code
It's more cleanly to use for_each_set_bit() instead of opencoding it. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Fei Li <fei1.li@intel.com> Link: https://lore.kernel.org/r/20220704125044.2192381-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/virt')
-rw-r--r--drivers/virt/acrn/ioreq.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/virt/acrn/ioreq.c b/drivers/virt/acrn/ioreq.c
index 5ff1c53740c0..d75ab3f66da4 100644
--- a/drivers/virt/acrn/ioreq.c
+++ b/drivers/virt/acrn/ioreq.c
@@ -246,12 +246,8 @@ void acrn_ioreq_request_clear(struct acrn_vm *vm)
spin_lock_bh(&vm->ioreq_clients_lock);
client = vm->default_client;
if (client) {
- vcpu = find_first_bit(client->ioreqs_map, ACRN_IO_REQUEST_MAX);
- while (vcpu < ACRN_IO_REQUEST_MAX) {
+ for_each_set_bit(vcpu, client->ioreqs_map, ACRN_IO_REQUEST_MAX)
acrn_ioreq_complete_request(client, vcpu, NULL);
- vcpu = find_next_bit(client->ioreqs_map,
- ACRN_IO_REQUEST_MAX, vcpu + 1);
- }
}
spin_unlock_bh(&vm->ioreq_clients_lock);