From patchwork Fri Jun 25 02:03:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: huqiqiao X-Patchwork-Id: 12343487 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFBB8C49EA6 for ; Fri, 25 Jun 2021 02:03:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55F79613B9 for ; Fri, 25 Jun 2021 02:03:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55F79613B9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=uniontech.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E39156E12D; Fri, 25 Jun 2021 02:03:57 +0000 (UTC) Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.135]) by gabe.freedesktop.org (Postfix) with ESMTPS id F0ED96E12D for ; Fri, 25 Jun 2021 02:03:56 +0000 (UTC) Received: from localhost (unknown [192.168.167.235]) by lucky1.263xmail.com (Postfix) with ESMTP id 86DD1B1916; Fri, 25 Jun 2021 10:03:49 +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 P1334T140034502022912S1624586622420447_; Fri, 25 Jun 2021 10:03:49 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <7e806d5e61b4e62798b4abb7502b1da4> X-RL-SENDER: huqiqiao@uniontech.com X-SENDER: huqiqiao@uniontech.com X-LOGIN-NAME: huqiqiao@uniontech.com X-FST-TO: alexander.deucher@amd.com X-RCPT-COUNT: 5 X-SENDER-IP: 58.240.82.166 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: huqiqiao To: alexander.deucher@amd.com, christian.koenig@amd.com Subject: [PATCH] drm/amdgpu: use kvcalloc for entry->entries Date: Fri, 25 Jun 2021 10:03:44 +0800 Message-Id: <20210625020344.30979-1-huqiqiao@uniontech.com> X-Mailer: git-send-email 2.11.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, huqiqiao Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" malloc_array + __GFP_ZERO is the same with kvcalloc. Signed-off-by: huqiqiao --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index b8c31e3469c0..5cadfadc625f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -909,7 +909,7 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev, num_entries = amdgpu_vm_num_entries(adev, cursor->level); entry->entries = kvcalloc(num_entries, - sizeof(*entry->entries), GFP_KERNEL); + sizeof(*entry->entries), GFP_KERNEL); if (!entry->entries) return -ENOMEM; }