Skip to content

Commit

Permalink
virt: acrn: using for_each_set_bit to simplify the code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yang Yingliang authored and Greg Kroah-Hartman committed Jul 8, 2022
1 parent 64c5916 commit e5535ff
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/virt/acrn/ioreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e5535ff

Please sign in to comment.