<style>table.customTableClassName {margin-bottom: 10px;border-collapse: collapse;display: table;}.customTableClassName td, .customTableClassName th {border: 1px solid #ddd;}</style><p style="margin:0px;"><br></p><p style="margin:0px;">OK, I'll revise it and submit it again</p><p style="margin:0px;"><br></p><p style="margin:0px;">George.</p><p style="margin:0px;"><br>
  </p><div style="padding:5px;padding-left:0px;border-top:solid #999 1.0pt;font-family: arial; font-size:12px;margin-bottom:20px;"><p style="margin:0px;"><strong>From:</strong> "Christian König <ckoenig.leichtzumerken@gmail.com>"</p><p style="margin:0px;"><strong>To:</strong> "huqiqiao <huqiqiao@uniontech.com>","airlied <airlied@linux.ie>","daniel <daniel@ffwll.ch>"</p><p style="margin:0px;"><strong>CC:</strong> "dri-devel <dri-devel@lists.freedesktop.org>","amd-gfx <amd-gfx@lists.freedesktop.org>","linux-kernel <linux-kernel@vger.kernel.org>"</p><p style="margin:0px;"><strong>Sent:</strong> 2021-06-24 21:14</p><p style="margin:0px;"><strong>Subject:</strong> Re: [PATCH] drm/amdgpu:use kvcalloc instead of kvmalloc_array</p></div><p style="margin:0px;"><br>
  <br>Am 23.06.21 um 11:12 schrieb huqiqiao:  <br>> kvmalloc_array + __GFP_ZERO is the same with kvcalloc.  <br>>  <br>> Signed-off-by: huqiqiao <huqiqiao@uniontech.com>  <br>> ---  <br>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++---  <br>> 1 file changed, 2 insertions(+), 3 deletions(-)  <br>>  <br>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c  <br>> index 9acee4a5b2ba..50edc73525b0 100644  <br>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c  <br>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c  <br>> @@ -908,9 +908,8 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev,  <br>> unsigned num_entries;  <br>> 
  <br>> num_entries = amdgpu_vm_num_entries(adev, cursor->level);  <br>> - entry->entries = kvmalloc_array(num_entries,  <br>> - sizeof(*entry->entries),  <br>> - GFP_KERNEL | __GFP_ZERO);  <br>> + entry->entries = kvcalloc(num_entries,  <br>> + sizeof(*entry->entries), GFP_KERNEL);  <br>
  <br>Sounds like a good idea in general, but the indentation on the second 
  <br>line seems to be of.  <br>
  <br>Christian.  <br>
  <br>> if (!entry->entries)  <br>> return -ENOMEM;  <br>> }  <br>
  <br>
  <br>
  <br>
 </p>