From dcaaff4eed13c4dcc15525ff87269b3f4544345a Mon Sep 17 00:00:00 2001 From: Philip Yang Date: Wed, 29 Aug 2018 10:53:23 -0400 Subject: [PATCH] drm/amdgpu: remove redundant memset MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Philip Yang Reviewed-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- 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 521ddb358ec1..f50697df9799 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -541,7 +541,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.30.2