* [PATCH] drm: amd: amdgpu: Remove NULL check not needed before freeing functions
@ 2019-10-29 9:19 ` Saurav Girepunje
0 siblings, 0 replies; 6+ messages in thread
From: Saurav Girepunje @ 2019-10-29 9:19 UTC (permalink / raw)
To: alexander.deucher, christian.koenig, David1.Zhou, airlied, daniel,
tom.stdenis, xywang.sjtu, Jack.Xiao, sam, Kevin1.Wang,
saurav.girepunje, amd-gfx, dri-devel, linux-kernel
Cc: saurav.girepunje
Remove unneeded NULL check before freeing functions
kfree and debugfs_remove.
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 5652cc72ed3a..cb94627fc0f4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1077,8 +1077,7 @@ static int amdgpu_debugfs_ib_preempt(void *data, u64 val)
ttm_bo_unlock_delayed_workqueue(&adev->mman.bdev, resched);
- if (fences)
- kfree(fences);
+ kfree(fences);
return 0;
}
@@ -1103,8 +1102,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev)
{
- if (adev->debugfs_preempt)
- debugfs_remove(adev->debugfs_preempt);
+ debugfs_remove(adev->debugfs_preempt);
}
#else
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] drm: amd: amdgpu: Remove NULL check not needed before freeing functions
@ 2019-10-29 9:19 ` Saurav Girepunje
0 siblings, 0 replies; 6+ messages in thread
From: Saurav Girepunje @ 2019-10-29 9:19 UTC (permalink / raw)
To: alexander.deucher, christian.koenig, David1.Zhou, airlied, daniel,
tom.stdenis, xywang.sjtu, Jack.Xiao, sam, Kevin1.Wang,
saurav.girepunje, amd-gfx, dri-devel, linux-kernel
Cc: saurav.girepunje
Remove unneeded NULL check before freeing functions
kfree and debugfs_remove.
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 5652cc72ed3a..cb94627fc0f4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1077,8 +1077,7 @@ static int amdgpu_debugfs_ib_preempt(void *data, u64 val)
ttm_bo_unlock_delayed_workqueue(&adev->mman.bdev, resched);
- if (fences)
- kfree(fences);
+ kfree(fences);
return 0;
}
@@ -1103,8 +1102,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev)
{
- if (adev->debugfs_preempt)
- debugfs_remove(adev->debugfs_preempt);
+ debugfs_remove(adev->debugfs_preempt);
}
#else
--
2.20.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] drm: amd: amdgpu: Remove NULL check not needed before freeing functions
@ 2019-10-29 9:19 ` Saurav Girepunje
0 siblings, 0 replies; 6+ messages in thread
From: Saurav Girepunje @ 2019-10-29 9:19 UTC (permalink / raw)
To: alexander.deucher, christian.koenig, David1.Zhou, airlied, daniel,
tom.stdenis, xywang.sjtu, Jack.Xiao, sam, Kevin1.Wang,
saurav.girepunje, amd-gfx, dri-devel, linux-kernel
Cc: saurav.girepunje
Remove unneeded NULL check before freeing functions
kfree and debugfs_remove.
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 5652cc72ed3a..cb94627fc0f4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1077,8 +1077,7 @@ static int amdgpu_debugfs_ib_preempt(void *data, u64 val)
ttm_bo_unlock_delayed_workqueue(&adev->mman.bdev, resched);
- if (fences)
- kfree(fences);
+ kfree(fences);
return 0;
}
@@ -1103,8 +1102,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev)
{
- if (adev->debugfs_preempt)
- debugfs_remove(adev->debugfs_preempt);
+ debugfs_remove(adev->debugfs_preempt);
}
#else
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm: amd: amdgpu: Remove NULL check not needed before freeing functions
@ 2019-10-29 9:33 ` Wang, Kevin(Yang)
0 siblings, 0 replies; 6+ messages in thread
From: Wang, Kevin(Yang) @ 2019-10-29 9:33 UTC (permalink / raw)
To: Saurav Girepunje, Deucher, Alexander, Koenig, Christian,
Zhou, David(ChunMing), airlied-cv59FeDIM0c@public.gmane.org,
daniel-/w4YWyX8dFk@public.gmane.org, StDenis, Tom,
xywang.sjtu-u2tTgNRCH2jM1kAEIRd3EQ@public.gmane.org, Xiao, Jack,
sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: saurav.girepunje-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org
[-- Attachment #1.1: Type: text/plain, Size: 3430 bytes --]
Hi Saurav,
the driver already has the same fix patch,
you can pull the latest driver tree and check it again,
thanks.
>From 2032324682c1ca563e33c56e51d9ae17a2b38105 Mon Sep 17 00:00:00 2001
From: zhong jiang <zhongjiang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Date: Tue, 3 Sep 2019 14:15:05 +0800
Subject: [PATCH] drm/amdgpu: remove the redundant null checks
debugfs_remove and kfree has taken the null check in account.
hence it is unnecessary to check it. Just remove the condition.
No functional change.
This issue was detected by using the Coccinelle software.
Signed-off-by: zhong jiang <zhongjiang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
Best Regards,
Kevin
________________________________
From: Saurav Girepunje <saurav.girepunje-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Tuesday, October 29, 2019 5:19 PM
To: Deucher, Alexander <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>; Koenig, Christian <Christian.Koenig-5C7GfCeVMHo@public.gmane.org>; Zhou, David(ChunMing) <David1.Zhou-5C7GfCeVMHo@public.gmane.org>; airlied@linux.ie <airlied-cv59FeDIM0c@public.gmane.org>; daniel-/w4YWyX8dFk@public.gmane.org <daniel-/w4YWyX8dFk@public.gmane.org>; StDenis, Tom <Tom.StDenis-5C7GfCeVMHo@public.gmane.org>; xywang.sjtu-u2tTgNRCH2jM1kAEIRd3EQ@public.gmane.org <xywang.sjtu-u2tTgNRCH2jM1kAEIRd3EQ@public.gmane.org>; Xiao, Jack <Jack.Xiao-5C7GfCeVMHo@public.gmane.org>; sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org <sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>; Wang, Kevin(Yang) <Kevin1.Wang-5C7GfCeVMHo@public.gmane.org>; saurav.girepunje-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <saurav.girepunje-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org <amd-gfx-PD4FTy7X32lNgt0PjOBp93gSJqDPrsil@public.gmane.org.org>; dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org <dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>; linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: saurav.girepunje-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org <saurav.girepunje-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH] drm: amd: amdgpu: Remove NULL check not needed before freeing functions
Remove unneeded NULL check before freeing functions
kfree and debugfs_remove.
Signed-off-by: Saurav Girepunje <saurav.girepunje-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 5652cc72ed3a..cb94627fc0f4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1077,8 +1077,7 @@ static int amdgpu_debugfs_ib_preempt(void *data, u64 val)
ttm_bo_unlock_delayed_workqueue(&adev->mman.bdev, resched);
- if (fences)
- kfree(fences);
+ kfree(fences);
return 0;
}
@@ -1103,8 +1102,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev)
{
- if (adev->debugfs_preempt)
- debugfs_remove(adev->debugfs_preempt);
+ debugfs_remove(adev->debugfs_preempt);
}
#else
--
2.20.1
[-- Attachment #1.2: Type: text/html, Size: 7055 bytes --]
[-- Attachment #2: Type: text/plain, Size: 153 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm: amd: amdgpu: Remove NULL check not needed before freeing functions
@ 2019-10-29 9:33 ` Wang, Kevin(Yang)
0 siblings, 0 replies; 6+ messages in thread
From: Wang, Kevin(Yang) @ 2019-10-29 9:33 UTC (permalink / raw)
To: Saurav Girepunje, Deucher, Alexander, Koenig, Christian,
Zhou, David(ChunMing), airlied@linux.ie, daniel@ffwll.ch,
StDenis, Tom, xywang.sjtu@sjtu.edu.cn, Xiao, Jack,
sam@ravnborg.org, amd-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: saurav.girepunje@hotmail.com
[-- Attachment #1.1: Type: text/plain, Size: 2714 bytes --]
Hi Saurav,
the driver already has the same fix patch,
you can pull the latest driver tree and check it again,
thanks.
From 2032324682c1ca563e33c56e51d9ae17a2b38105 Mon Sep 17 00:00:00 2001
From: zhong jiang <zhongjiang@huawei.com>
Date: Tue, 3 Sep 2019 14:15:05 +0800
Subject: [PATCH] drm/amdgpu: remove the redundant null checks
debugfs_remove and kfree has taken the null check in account.
hence it is unnecessary to check it. Just remove the condition.
No functional change.
This issue was detected by using the Coccinelle software.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Best Regards,
Kevin
________________________________
From: Saurav Girepunje <saurav.girepunje@gmail.com>
Sent: Tuesday, October 29, 2019 5:19 PM
To: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; Zhou, David(ChunMing) <David1.Zhou@amd.com>; airlied@linux.ie <airlied@linux.ie>; daniel@ffwll.ch <daniel@ffwll.ch>; StDenis, Tom <Tom.StDenis@amd.com>; xywang.sjtu@sjtu.edu.cn <xywang.sjtu@sjtu.edu.cn>; Xiao, Jack <Jack.Xiao@amd.com>; sam@ravnborg.org <sam@ravnborg.org>; Wang, Kevin(Yang) <Kevin1.Wang@amd.com>; saurav.girepunje@gmail.com <saurav.girepunje@gmail.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>
Cc: saurav.girepunje@hotmail.com <saurav.girepunje@hotmail.com>
Subject: [PATCH] drm: amd: amdgpu: Remove NULL check not needed before freeing functions
Remove unneeded NULL check before freeing functions
kfree and debugfs_remove.
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 5652cc72ed3a..cb94627fc0f4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1077,8 +1077,7 @@ static int amdgpu_debugfs_ib_preempt(void *data, u64 val)
ttm_bo_unlock_delayed_workqueue(&adev->mman.bdev, resched);
- if (fences)
- kfree(fences);
+ kfree(fences);
return 0;
}
@@ -1103,8 +1102,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev)
{
- if (adev->debugfs_preempt)
- debugfs_remove(adev->debugfs_preempt);
+ debugfs_remove(adev->debugfs_preempt);
}
#else
--
2.20.1
[-- Attachment #1.2: Type: text/html, Size: 6342 bytes --]
[-- Attachment #2: Type: text/plain, Size: 153 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm: amd: amdgpu: Remove NULL check not needed before freeing functions
@ 2019-10-29 9:33 ` Wang, Kevin(Yang)
0 siblings, 0 replies; 6+ messages in thread
From: Wang, Kevin(Yang) @ 2019-10-29 9:33 UTC (permalink / raw)
To: Saurav Girepunje, Deucher, Alexander, Koenig, Christian,
Zhou, David(ChunMing), airlied@linux.ie, daniel@ffwll.ch,
StDenis, Tom, xywang.sjtu@sjtu.edu.cn, Xiao, Jack,
sam@ravnborg.org, amd-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: saurav.girepunje@hotmail.com
[-- Attachment #1.1: Type: text/plain, Size: 2714 bytes --]
Hi Saurav,
the driver already has the same fix patch,
you can pull the latest driver tree and check it again,
thanks.
From 2032324682c1ca563e33c56e51d9ae17a2b38105 Mon Sep 17 00:00:00 2001
From: zhong jiang <zhongjiang@huawei.com>
Date: Tue, 3 Sep 2019 14:15:05 +0800
Subject: [PATCH] drm/amdgpu: remove the redundant null checks
debugfs_remove and kfree has taken the null check in account.
hence it is unnecessary to check it. Just remove the condition.
No functional change.
This issue was detected by using the Coccinelle software.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Best Regards,
Kevin
________________________________
From: Saurav Girepunje <saurav.girepunje@gmail.com>
Sent: Tuesday, October 29, 2019 5:19 PM
To: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; Zhou, David(ChunMing) <David1.Zhou@amd.com>; airlied@linux.ie <airlied@linux.ie>; daniel@ffwll.ch <daniel@ffwll.ch>; StDenis, Tom <Tom.StDenis@amd.com>; xywang.sjtu@sjtu.edu.cn <xywang.sjtu@sjtu.edu.cn>; Xiao, Jack <Jack.Xiao@amd.com>; sam@ravnborg.org <sam@ravnborg.org>; Wang, Kevin(Yang) <Kevin1.Wang@amd.com>; saurav.girepunje@gmail.com <saurav.girepunje@gmail.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>
Cc: saurav.girepunje@hotmail.com <saurav.girepunje@hotmail.com>
Subject: [PATCH] drm: amd: amdgpu: Remove NULL check not needed before freeing functions
Remove unneeded NULL check before freeing functions
kfree and debugfs_remove.
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 5652cc72ed3a..cb94627fc0f4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1077,8 +1077,7 @@ static int amdgpu_debugfs_ib_preempt(void *data, u64 val)
ttm_bo_unlock_delayed_workqueue(&adev->mman.bdev, resched);
- if (fences)
- kfree(fences);
+ kfree(fences);
return 0;
}
@@ -1103,8 +1102,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
void amdgpu_debugfs_preempt_cleanup(struct amdgpu_device *adev)
{
- if (adev->debugfs_preempt)
- debugfs_remove(adev->debugfs_preempt);
+ debugfs_remove(adev->debugfs_preempt);
}
#else
--
2.20.1
[-- Attachment #1.2: Type: text/html, Size: 6342 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-10-30 8:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-29 9:19 [PATCH] drm: amd: amdgpu: Remove NULL check not needed before freeing functions Saurav Girepunje
2019-10-29 9:19 ` Saurav Girepunje
2019-10-29 9:19 ` Saurav Girepunje
2019-10-29 9:33 ` Wang, Kevin(Yang)
2019-10-29 9:33 ` Wang, Kevin(Yang)
2019-10-29 9:33 ` Wang, Kevin(Yang)
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.