]> git.baikalelectronics.ru Git - kernel.git/commitdiff
habanalabs: use kvcalloc when possible
authorOded Gabbay <ogabbay@kernel.org>
Sun, 19 Jun 2022 09:40:19 +0000 (12:40 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Tue, 12 Jul 2022 06:09:24 +0000 (09:09 +0300)
kvcalloc is same as kvmalloc_array with GFP_ZERO.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/mmu/mmu_v1.c

index ad4b49281cd7ca17bb488c657e67b05c967424bc..8a40de4a47617c46ce6deb6dceb7334bf425cb22 100644 (file)
@@ -393,9 +393,8 @@ static int hl_mmu_v1_init(struct hl_device *hdev)
                goto err_pool_add;
        }
 
-       hdev->mmu_priv.dr.mmu_shadow_hop0 = kvmalloc_array(prop->max_asid,
-                                               prop->mmu_hop_table_size,
-                                               GFP_KERNEL | __GFP_ZERO);
+       hdev->mmu_priv.dr.mmu_shadow_hop0 = kvcalloc(prop->max_asid, prop->mmu_hop_table_size,
+                                                                               GFP_KERNEL);
        if (ZERO_OR_NULL_PTR(hdev->mmu_priv.dr.mmu_shadow_hop0)) {
                rc = -ENOMEM;
                goto err_pool_add;