[PATCH] riscv: mm: Use better bitmap_zalloc()

Palmer Dabbelt palmer at dabbelt.com
Tue Jun 8 17:12:42 PDT 2021


On Sat, 29 May 2021 04:15:34 PDT (-0700), wangkefeng.wang at huawei.com wrote:
> Use better bitmap_zalloc() to allocate bitmap.
>
> Cc: Palmer Dabbelt <palmerdabbelt at google.com>
> Cc: Paul Walmsley <paul.walmsley at sifive.com>
> Cc: Palmer Dabbelt <palmer at dabbelt.com>
> Cc: linux-riscv at lists.infradead.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang at huawei.com>
> ---
>  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 83e7ae37675a..2aba0a6343d9 100644
> --- a/arch/riscv/mm/context.c
> +++ b/arch/riscv/mm/context.c
> @@ -243,8 +243,7 @@ static int asids_init(void)
>  	if (num_asids > (2 * num_possible_cpus())) {
>  		atomic_long_set(&current_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);

Thanks, this is on for-next.



More information about the linux-riscv mailing list