Skip to contentSkip to conversation

arm64: mm: Use better bitmap_zalloc()

PATCH Applied Kefeng Wang 2 participants 2 messages May 29, 2021 – Jun 1, 2021 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: mm: Use better bitmap_zalloc()

Use better bitmap_zalloc() to allocate bitmap.

---
 arch/arm64/mm/context.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
arch/arm64/mm/context.c +2 -4
index 001737a8f309..cd72576ae2b7 100644
@@ -402,14 +402,12 @@ static int asids_init(void)
 {
 	asid_bits = get_cpu_asid_bits();
 	atomic64_set(&asid_generation, ASID_FIRST_VERSION);
-	asid_map = kcalloc(BITS_TO_LONGS(NUM_USER_ASIDS), sizeof(*asid_map),
-			   GFP_KERNEL);
+	asid_map = bitmap_zalloc(NUM_USER_ASIDS, GFP_KERNEL);
 	if (!asid_map)
 		panic("Failed to allocate bitmap for %lu ASIDs\n",
 		      NUM_USER_ASIDS);
 
-	pinned_asid_map = kcalloc(BITS_TO_LONGS(NUM_USER_ASIDS),
-				  sizeof(*pinned_asid_map), GFP_KERNEL);
+	pinned_asid_map = bitmap_zalloc(NUM_USER_ASIDS, GFP_KERNEL);
 	nr_pinned_asids = 0;
 
 	/*
Signature · 7 lines
2.26.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Applied
#1 lore raw
Quoted 1 line · Kefeng Wang

Use better bitmap_zalloc() to allocate bitmap.

Applied to arm64 (for-next/mm), thanks!

[1/1] arm64: mm: Use better bitmap_zalloc()

      https://git.kernel.org/arm64/c/5ae632ed356c

Cheers,

Signature · 10 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel