<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Philip Yang <Philip.Yang@amd.com><br>
<b>Sent:</b> Wednesday, August 29, 2018 11:17:44 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Yang, Philip<br>
<b>Subject:</b> [PATCH] drm/amdgpu: remove redundant memset</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">kvmalloc_array uses __GFP_ZERO flag ensures that the returned address<br>
is zeroed already, memset it to zero again afterwards is unnecessary,<br>
and in this case buggy because we only clear the first entry.<br>
<br>
Change-Id: If94a59d3cbf2690dd2a1e2add71bc393df6a9686<br>
Signed-off-by: Philip Yang <Philip.Yang@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 -<br>
1 file changed, 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
index 153c9be..33d9ce2 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
@@ -540,7 +540,6 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,<br>
GFP_KERNEL | __GFP_ZERO);<br>
if (!parent->entries)<br>
return -ENOMEM;<br>
- memset(parent->entries, 0 , sizeof(struct amdgpu_vm_pt));<br>
}<br>
<br>
from = saddr >> shift;<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>