projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4be8ddb
)
KVM: arm64: Use the bitmap API to allocate bitmaps
author
Christophe JAILLET
<christophe.jaillet@wanadoo.fr>
Tue, 18 Apr 2023 21:47:38 +0000
(23:47 +0200)
committer
Marc Zyngier
<maz@kernel.org>
Thu, 20 Apr 2023 08:10:28 +0000
(09:10 +0100)
Use bitmap_zalloc()/bitmap_free() instead of hand-writing them.
It is less verbose and it improves the semantic.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link:
https://lore.kernel.org/r/3c5043731db4d3635383e9326bc7e98e25de3288.1681854412.git.christophe.jaillet@wanadoo.fr
arch/arm64/kvm/vmid.c
patch
|
blob
|
history
diff --git
a/arch/arm64/kvm/vmid.c
b/arch/arm64/kvm/vmid.c
index bbf0677cfefa9c8d2fc4f8157194589673ae1a02..7fe8ba1a2851c5b71acbf17075987b96436f1a4a 100644
(file)
--- a/
arch/arm64/kvm/vmid.c
+++ b/
arch/arm64/kvm/vmid.c
@@
-182,8
+182,7
@@
int __init kvm_arm_vmid_alloc_init(void)
*/
WARN_ON(NUM_USER_VMIDS - 1 <= num_possible_cpus());
atomic64_set(&vmid_generation, VMID_FIRST_VERSION);
- vmid_map = kcalloc(BITS_TO_LONGS(NUM_USER_VMIDS),
- sizeof(*vmid_map), GFP_KERNEL);
+ vmid_map = bitmap_zalloc(NUM_USER_VMIDS, GFP_KERNEL);
if (!vmid_map)
return -ENOMEM;
@@
-192,5
+191,5
@@
int __init kvm_arm_vmid_alloc_init(void)
void __init kvm_arm_vmid_alloc_free(void)
{
-
k
free(vmid_map);
+
bitmap_
free(vmid_map);
}