* [PATCH] drm/amdgpu: remove redundant memset
@ 2018-08-29 15:01 Philip Yang
[not found] ` <1535554880-1503-1-git-send-email-Philip.Yang-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Philip Yang @ 2018-08-29 15:01 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Philip Yang
Change-Id: If94a59d3cbf2690dd2a1e2add71bc393df6a9686
Signed-off-by: Philip Yang <Philip.Yang@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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/amdgpu: remove redundant memset
[not found] ` <1535554880-1503-1-git-send-email-Philip.Yang-5C7GfCeVMHo@public.gmane.org>
@ 2018-08-29 15:05 ` Christian König
0 siblings, 0 replies; 7+ messages in thread
From: Christian König @ 2018-08-29 15:05 UTC (permalink / raw)
To: Philip Yang, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Am 29.08.2018 um 17:01 schrieb Philip Yang:
> Change-Id: If94a59d3cbf2690dd2a1e2add71bc393df6a9686
> Signed-off-by: Philip Yang <Philip.Yang@amd.com>
You need to add a commit message, explaining why that can be removed.
With that done the patch is Reviewed-by: Christian König
<christian.koenig@amd.com>.
Regards,
Christian.
> ---
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] drm/amdgpu: remove redundant memset
@ 2018-08-29 15:13 Philip Yang
[not found] ` <1535555623-2177-1-git-send-email-Philip.Yang-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Philip Yang @ 2018-08-29 15:13 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Philip Yang
kvmalloc_array uses __GFP_ZERO flag ensures that the returned address
is zeroed already, memset it to zero again afterwards is unnecessary
Change-Id: If94a59d3cbf2690dd2a1e2add71bc393df6a9686
Signed-off-by: Philip Yang <Philip.Yang@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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/amdgpu: remove redundant memset
[not found] ` <1535555623-2177-1-git-send-email-Philip.Yang-5C7GfCeVMHo@public.gmane.org>
@ 2018-08-29 15:15 ` Christian König
0 siblings, 0 replies; 7+ messages in thread
From: Christian König @ 2018-08-29 15:15 UTC (permalink / raw)
To: Philip Yang, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Am 29.08.2018 um 17:13 schrieb Philip Yang:
> 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>
Reviewed-by: Christian König <christian.koenig@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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] drm/amdgpu: remove redundant memset
@ 2018-08-29 15:17 Philip Yang
[not found] ` <1535555864-2521-1-git-send-email-Philip.Yang-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Philip Yang @ 2018-08-29 15:17 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Philip Yang
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>
---
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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/amdgpu: remove redundant memset
[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)
1 sibling, 0 replies; 7+ messages in thread
From: Deucher, Alexander @ 2018-08-29 15:46 UTC (permalink / raw)
To: Yang, Philip,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
[-- Attachment #1.1: Type: text/plain, Size: 1646 bytes --]
Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Philip Yang <Philip.Yang-5C7GfCeVMHo@public.gmane.org>
Sent: Wednesday, August 29, 2018 11:17:44 AM
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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-5C7GfCeVMHo@public.gmane.org>
---
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-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[-- Attachment #1.2: Type: text/html, Size: 3232 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/amdgpu: remove redundant memset
[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)
1 sibling, 0 replies; 7+ messages in thread
From: Zhang, Jerry (Junwei) @ 2018-08-30 1:39 UTC (permalink / raw)
To: Philip Yang, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-08-30 1:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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)
-- 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
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.