dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/msm: Remove redundant null check
@ 2020-10-19  6:04 Tian Tao
  2020-10-19 14:49 ` [Freedreno] " Jordan Crouse
  0 siblings, 1 reply; 3+ 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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [Freedreno] [PATCH] drm/msm: Remove redundant null check
  2020-10-19  6:04 [PATCH] drm/msm: Remove redundant null check Tian Tao
@ 2020-10-19 14:49 ` Jordan Crouse
  0 siblings, 0 replies; 3+ messages in thread
From: Jordan Crouse @ 2020-10-19 14:49 UTC (permalink / raw)
  To: Tian Tao; +Cc: freedreno, airlied, linux-arm-msm, linux-kernel, dri-devel, sean

On Mon, Oct 19, 2020 at 02:04:22PM +0800, Tian Tao wrote:
> clk_prepare_enable() and clk_disable_unprepare() will check
> NULL clock parameter, so It is not necessary to add additional checks.

Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>

> 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
> 
> _______________________________________________
> Freedreno mailing list
> Freedreno@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/freedreno

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH] drm/msm: remove redundant NULL check
@ 2021-01-26  9:51 Jiapeng Zhong
  0 siblings, 0 replies; 3+ messages in thread
From: Jiapeng Zhong @ 2021-01-26  9:51 UTC (permalink / raw)
  To: robdclark
  Cc: freedreno, airlied, linux-arm-msm, linux-kernel, dri-devel,
	christian.koenig, linaro-mm-sig, Jiapeng Zhong, sean,
	linux-media

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2021-01-27  8:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19  6:04 [PATCH] drm/msm: Remove redundant null check Tian Tao
2020-10-19 14:49 ` [Freedreno] " Jordan Crouse
2021-01-26  9:51 [PATCH] drm/msm: remove redundant NULL check Jiapeng Zhong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).