Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5486654pxj; Wed, 23 Jun 2021 02:14:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCMKQdSa27Xv79JcdApHLxOFylhqRUXS3AuWrqGhdafFNM4OOo6xLbDloXtk9clLi2ogPR X-Received: by 2002:a02:9f05:: with SMTP id z5mr8049131jal.23.1624439689767; Wed, 23 Jun 2021 02:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624439689; cv=none; d=google.com; s=arc-20160816; b=kxxeXko/kmNjFqF1+qOyELQZGGyWC0ZCYFZXRetuIb9j3nuvm+q9NGd+bvKEaF4i3e A5/DNt//zdLpas10fsWa2EmM/so/4dqRXKSQnSDwXI8h0e/i4M5j+rzJdr/aVeFRcP0q ZHCO2SNNOnRX0SsVlOi956jEnzhqPQl6BtmaHPRoDM6plDFsbuM4+bRxlfO67bLtukIQ sBxNgevptCMS1wPPn3wa7he/BSJFs10TwKMfa1DiKu6XeoyEDRXj/pEmZJEqq3dqKQZt FfssjkkBvGRsp5AllGZ/cZkquGIFtG2WkmVciKXjR3VP70wQvRxHFsiJzOSMfX5I/J7X uhSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=9DVd9PLPB/TB2DkXbhZZs/3+FbygjLvfObx4YQE5DEs=; b=WJkNJG3MG/SNWTzPziw9nsNQMbhfsEt9Qaz7uLMpkyAXesj8cGM9FTI65UAja8ji6D ca1TS5l6AbEk8P2GH1eLvQRgcnD19JeUjIl+zDzH9pf8OMOcMEZ99+Yxpqae9Gx/vylD 8YeWQ1otD5x24gwFDdqj065Y8YwP+QV2DqhK0PveBhQsC+/vvXuE3h0MdSQlHIqswBcG PZTp5qt7CiII8IdPPJ14Z69DRX/PVjc6kwyjEwgGyGYwVudGTAePu03+X5cZ90wR/v8o gMx6/RTTSWLEeAtlBaX/Rc44/jJnfzYnDVTfok0bdELoPHha2RrYry0NWTOYn1Y6JhQd zYIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s10si5560413iln.135.2021.06.23.02.14.37; Wed, 23 Jun 2021 02:14:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229918AbhFWJPO (ORCPT + 99 others); Wed, 23 Jun 2021 05:15:14 -0400 Received: from lucky1.263xmail.com ([211.157.147.132]:53732 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230135AbhFWJPN (ORCPT ); Wed, 23 Jun 2021 05:15:13 -0400 Received: from localhost (unknown [192.168.167.224]) by lucky1.263xmail.com (Postfix) with ESMTP id 6C78CFAC1D; Wed, 23 Jun 2021 17:12:53 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED: 0 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.240.82.166]) by smtp.263.net (postfix) whith ESMTP id P4528T140206187476736S1624439563868494_; Wed, 23 Jun 2021 17:12:48 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <20a6f2888ef16c71f2ba7213c491eac8> X-RL-SENDER: huqiqiao@uniontech.com X-SENDER: huqiqiao@uniontech.com X-LOGIN-NAME: huqiqiao@uniontech.com X-FST-TO: airlied@linux.ie X-RCPT-COUNT: 6 X-SENDER-IP: 58.240.82.166 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: huqiqiao To: airlied@linux.ie, daniel@ffwll.ch Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, huqiqiao Subject: [PATCH] drm/amdgpu:use kvcalloc instead of kvmalloc_array Date: Wed, 23 Jun 2021 17:12:42 +0800 Message-Id: <20210623091242.12861-1-huqiqiao@uniontech.com> X-Mailer: git-send-email 2.11.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kvmalloc_array + __GFP_ZERO is the same with kvcalloc. Signed-off-by: huqiqiao --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 9acee4a5b2ba..50edc73525b0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -908,9 +908,8 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev, unsigned num_entries; num_entries = amdgpu_vm_num_entries(adev, cursor->level); - entry->entries = kvmalloc_array(num_entries, - sizeof(*entry->entries), - GFP_KERNEL | __GFP_ZERO); + entry->entries = kvcalloc(num_entries, + sizeof(*entry->entries), GFP_KERNEL); if (!entry->entries) return -ENOMEM; } -- 2.11.0