mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
arm64: mm: Use better bitmap_zalloc()
Use better bitmap_zalloc() to allocate bitmap. Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Link: https://lore.kernel.org/r/20210529111510.186355-1-wangkefeng.wang@huawei.com Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
parent
40221c7376
commit
5ae632ed35
@ -402,14 +402,12 @@ static int asids_init(void)
|
|||||||
{
|
{
|
||||||
asid_bits = get_cpu_asid_bits();
|
asid_bits = get_cpu_asid_bits();
|
||||||
atomic64_set(&asid_generation, ASID_FIRST_VERSION);
|
atomic64_set(&asid_generation, ASID_FIRST_VERSION);
|
||||||
asid_map = kcalloc(BITS_TO_LONGS(NUM_USER_ASIDS), sizeof(*asid_map),
|
asid_map = bitmap_zalloc(NUM_USER_ASIDS, GFP_KERNEL);
|
||||||
GFP_KERNEL);
|
|
||||||
if (!asid_map)
|
if (!asid_map)
|
||||||
panic("Failed to allocate bitmap for %lu ASIDs\n",
|
panic("Failed to allocate bitmap for %lu ASIDs\n",
|
||||||
NUM_USER_ASIDS);
|
NUM_USER_ASIDS);
|
||||||
|
|
||||||
pinned_asid_map = kcalloc(BITS_TO_LONGS(NUM_USER_ASIDS),
|
pinned_asid_map = bitmap_zalloc(NUM_USER_ASIDS, GFP_KERNEL);
|
||||||
sizeof(*pinned_asid_map), GFP_KERNEL);
|
|
||||||
nr_pinned_asids = 0;
|
nr_pinned_asids = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user