[PATCH] drm/amdgpu: remove redundant memset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

________________________________
From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> on behalf of Philip Yang <Philip.Yang at amd.com>
Sent: Wednesday, August 29, 2018 11:17:44 AM
To: amd-gfx at lists.freedesktop.org
Cc: Yang, Philip
Subject: [PATCH] drm/amdgpu: remove redundant memset

kvmalloc_array uses __GFP_ZERO flag ensures that the returned address
is zeroed already, memset it to zero again afterwards is unnecessary,
and in this case buggy because we only clear the first entry.

Change-Id: If94a59d3cbf2690dd2a1e2add71bc393df6a9686
Signed-off-by: Philip Yang <Philip.Yang at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 153c9be..33d9ce2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -540,7 +540,6 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,
                                                    GFP_KERNEL | __GFP_ZERO);
                 if (!parent->entries)
                         return -ENOMEM;
-               memset(parent->entries, 0 , sizeof(struct amdgpu_vm_pt));
         }

         from = saddr >> shift;
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20180829/3ef870a6/attachment.html>


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux