From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: Philip Yang <Philip.Yang-5C7GfCeVMHo@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu: remove redundant memset
Date: Thu, 30 Aug 2018 09:39:46 +0800 [thread overview]
Message-ID: <5B874AE2.4080302@amd.com> (raw)
In-Reply-To: <1535555864-2521-1-git-send-email-Philip.Yang-5C7GfCeVMHo@public.gmane.org>
On 08/29/2018 11:17 PM, Philip Yang wrote:
> 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@amd.com>
Good catch.
Reviewed-by: Junwei Zhang <Jerry.Zhang@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;
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-08-30 1:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-29 15:17 [PATCH] drm/amdgpu: remove redundant memset Philip Yang
[not found] ` <1535555864-2521-1-git-send-email-Philip.Yang-5C7GfCeVMHo@public.gmane.org>
2018-08-29 15:46 ` Deucher, Alexander
2018-08-30 1:39 ` Zhang, Jerry (Junwei) [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-08-29 15:13 Philip Yang
[not found] ` <1535555623-2177-1-git-send-email-Philip.Yang-5C7GfCeVMHo@public.gmane.org>
2018-08-29 15:15 ` Christian König
2018-08-29 15:01 Philip Yang
[not found] ` <1535554880-1503-1-git-send-email-Philip.Yang-5C7GfCeVMHo@public.gmane.org>
2018-08-29 15:05 ` Christian König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5B874AE2.4080302@amd.com \
--to=jerry.zhang-5c7gfcevmho@public.gmane.org \
--cc=Philip.Yang-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.