All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/msm: remove redundant NULL check
@ 2021-01-26  9:51 ` Jiapeng Zhong
  0 siblings, 0 replies; 6+ messages in thread
From: Jiapeng Zhong @ 2021-01-26  9:51 UTC (permalink / raw)
  To: robdclark
  Cc: sean, airlied, daniel, sumit.semwal, christian.koenig,
	linux-arm-msm, dri-devel, freedreno, linux-kernel, linux-media,
	linaro-mm-sig, Jiapeng Zhong

Fix below warnings reported by coccicheck:
./drivers/gpu/drm/msm/msm_gem.c:991:3-9: WARNING: NULL check before some
freeing functions is not needed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
---
 drivers/gpu/drm/msm/msm_gem.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index 9d10739..4f1f1a0 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -987,8 +987,7 @@ void msm_gem_free_object(struct drm_gem_object *obj)
 		/* Don't drop the pages for imported dmabuf, as they are not
 		 * ours, just free the array we allocated:
 		 */
-		if (msm_obj->pages)
-			kvfree(msm_obj->pages);
+		kvfree(msm_obj->pages);
 
 		put_iova_vmas(obj);
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] drm/msm: Remove redundant null check
@ 2020-10-19  6:04 ` Tian Tao
  0 siblings, 0 replies; 6+ messages in thread
From: Tian Tao @ 2020-10-19  6:04 UTC (permalink / raw)
  To: robdclark, sean, airlied, daniel, linux-arm-msm, dri-devel,
	freedreno, linux-kernel

clk_prepare_enable() and clk_disable_unprepare() will check
NULL clock parameter, so It is not necessary to add additional checks.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/msm/msm_gpu.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 57ddc94..25bc654 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -175,15 +175,12 @@ static int disable_clk(struct msm_gpu *gpu)
 
 static int enable_axi(struct msm_gpu *gpu)
 {
-	if (gpu->ebi1_clk)
-		clk_prepare_enable(gpu->ebi1_clk);
-	return 0;
+	return clk_prepare_enable(gpu->ebi1_clk);
 }
 
 static int disable_axi(struct msm_gpu *gpu)
 {
-	if (gpu->ebi1_clk)
-		clk_disable_unprepare(gpu->ebi1_clk);
+	clk_disable_unprepare(gpu->ebi1_clk);
 	return 0;
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-01 20:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26  9:51 [PATCH] drm/msm: remove redundant NULL check Jiapeng Zhong
2021-01-26  9:51 ` Jiapeng Zhong
2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
  -- strict thread matches above, loose matches on Subject: below --
2020-10-19  6:04 [PATCH] drm/msm: Remove redundant null check Tian Tao
2020-10-19  6:04 ` Tian Tao
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm

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.