OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
64c5916
)
virt: acrn: using for_each_set_bit to simplify the code
author
Yang Yingliang
<yangyingliang@huawei.com>
Mon, 4 Jul 2022 12:50:44 +0000
(20:50 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 8 Jul 2022 13:42:10 +0000
(15:42 +0200)
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>
drivers/virt/acrn/ioreq.c
patch
|
blob
|
history
diff --git
a/drivers/virt/acrn/ioreq.c
b/drivers/virt/acrn/ioreq.c
index
5ff1c53
..
d75ab3f
100644
(file)
--- 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);