From 5def4429aefe65b494816d9ba8ae7f971d522251 Mon Sep 17 00:00:00 2001 From: Kefeng Wang Date: Sat, 29 May 2021 19:15:34 +0800 Subject: [PATCH] riscv: mm: Use better bitmap_zalloc() Use better bitmap_zalloc() to allocate bitmap. Signed-off-by: Kefeng Wang Signed-off-by: Palmer Dabbelt --- arch/riscv/mm/context.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/riscv/mm/context.c b/arch/riscv/mm/context.c index 9bc46ab01c25..25cb406737d4 100644 --- a/arch/riscv/mm/context.c +++ b/arch/riscv/mm/context.c @@ -243,8 +243,7 @@ static int __init asids_init(void) if (num_asids > (2 * num_possible_cpus())) { atomic_long_set(¤t_version, num_asids); - context_asid_map = kcalloc(BITS_TO_LONGS(num_asids), - sizeof(*context_asid_map), GFP_KERNEL); + context_asid_map = bitmap_zalloc(num_asids, GFP_KERNEL); if (!context_asid_map) panic("Failed to allocate bitmap for %lu ASIDs\n", num_asids); -- 2.11.0