linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/msm/adreno: remove return value of function XX_print
@ 2020-08-14  8:17 Bernard Zhao
  2020-08-17 17:26 ` [Freedreno] " Jordan Crouse
  0 siblings, 1 reply; 2+ messages in thread
From: Bernard Zhao @ 2020-08-14  8:17 UTC (permalink / raw)
  To: Rob Clark, Sean Paul, David Airlie, Daniel Vetter, Sam Ravnborg,
	Wambui Karuga, Greg Kroah-Hartman, Emil Velikov, Bernard Zhao,
	linux-arm-msm, dri-devel, freedreno, linux-kernel
  Cc: opensource.kernel

XX_print like pfp_print/me_print/meq_print/roq_print are just
used in file a5xx_debugfs.c. And these function always return
0, this return value is meaningless.
This change is to make the code a bit more readable.

Signed-off-by: Bernard Zhao <bernard@vivo.com>
---
 drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
index 68eddac7771c..fc2c905b6c9e 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
@@ -11,7 +11,7 @@
 
 #include "a5xx_gpu.h"
 
-static int pfp_print(struct msm_gpu *gpu, struct drm_printer *p)
+static void pfp_print(struct msm_gpu *gpu, struct drm_printer *p)
 {
 	int i;
 
@@ -22,11 +22,9 @@ static int pfp_print(struct msm_gpu *gpu, struct drm_printer *p)
 		drm_printf(p, "  %02x: %08x\n", i,
 			gpu_read(gpu, REG_A5XX_CP_PFP_STAT_DATA));
 	}
-
-	return 0;
 }
 
-static int me_print(struct msm_gpu *gpu, struct drm_printer *p)
+static void me_print(struct msm_gpu *gpu, struct drm_printer *p)
 {
 	int i;
 
@@ -37,11 +35,9 @@ static int me_print(struct msm_gpu *gpu, struct drm_printer *p)
 		drm_printf(p, "  %02x: %08x\n", i,
 			gpu_read(gpu, REG_A5XX_CP_ME_STAT_DATA));
 	}
-
-	return 0;
 }
 
-static int meq_print(struct msm_gpu *gpu, struct drm_printer *p)
+static void meq_print(struct msm_gpu *gpu, struct drm_printer *p)
 {
 	int i;
 
@@ -52,11 +48,9 @@ static int meq_print(struct msm_gpu *gpu, struct drm_printer *p)
 		drm_printf(p, "  %02x: %08x\n", i,
 			gpu_read(gpu, REG_A5XX_CP_MEQ_DBG_DATA));
 	}
-
-	return 0;
 }
 
-static int roq_print(struct msm_gpu *gpu, struct drm_printer *p)
+static void roq_print(struct msm_gpu *gpu, struct drm_printer *p)
 {
 	int i;
 
@@ -71,8 +65,6 @@ static int roq_print(struct msm_gpu *gpu, struct drm_printer *p)
 		drm_printf(p, "  %02x: %08x %08x %08x %08x\n", i,
 			val[0], val[1], val[2], val[3]);
 	}
-
-	return 0;
 }
 
 static int show(struct seq_file *m, void *arg)
@@ -81,10 +73,11 @@ static int show(struct seq_file *m, void *arg)
 	struct drm_device *dev = node->minor->dev;
 	struct msm_drm_private *priv = dev->dev_private;
 	struct drm_printer p = drm_seq_file_printer(m);
-	int (*show)(struct msm_gpu *gpu, struct drm_printer *p) =
+	void (*show)(struct msm_gpu *gpu, struct drm_printer *p) =
 		node->info_ent->data;
 
-	return show(priv->gpu, &p);
+	show(priv->gpu, &p);
+	return 0;
 }
 
 #define ENT(n) { .name = #n, .show = show, .data = n ##_print }
-- 
2.26.2


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

* Re: [Freedreno] [PATCH] drm/msm/adreno: remove return value of function XX_print
  2020-08-14  8:17 [PATCH] drm/msm/adreno: remove return value of function XX_print Bernard Zhao
@ 2020-08-17 17:26 ` Jordan Crouse
  0 siblings, 0 replies; 2+ messages in thread
From: Jordan Crouse @ 2020-08-17 17:26 UTC (permalink / raw)
  To: Bernard Zhao
  Cc: Rob Clark, Sean Paul, David Airlie, Daniel Vetter, Sam Ravnborg,
	Wambui Karuga, Greg Kroah-Hartman, Emil Velikov, linux-arm-msm,
	dri-devel, freedreno, linux-kernel, opensource.kernel

On Fri, Aug 14, 2020 at 01:17:44AM -0700, Bernard Zhao wrote:
> XX_print like pfp_print/me_print/meq_print/roq_print are just
> used in file a5xx_debugfs.c. And these function always return
> 0, this return value is meaningless.
> This change is to make the code a bit more readable.

This is reasonable.  I'm always for negative lines.

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

> Signed-off-by: Bernard Zhao <bernard@vivo.com>
> ---
>  drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
> index 68eddac7771c..fc2c905b6c9e 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
> @@ -11,7 +11,7 @@
>  
>  #include "a5xx_gpu.h"
>  
> -static int pfp_print(struct msm_gpu *gpu, struct drm_printer *p)
> +static void pfp_print(struct msm_gpu *gpu, struct drm_printer *p)
>  {
>  	int i;
>  
> @@ -22,11 +22,9 @@ static int pfp_print(struct msm_gpu *gpu, struct drm_printer *p)
>  		drm_printf(p, "  %02x: %08x\n", i,
>  			gpu_read(gpu, REG_A5XX_CP_PFP_STAT_DATA));
>  	}
> -
> -	return 0;
>  }
>  
> -static int me_print(struct msm_gpu *gpu, struct drm_printer *p)
> +static void me_print(struct msm_gpu *gpu, struct drm_printer *p)
>  {
>  	int i;
>  
> @@ -37,11 +35,9 @@ static int me_print(struct msm_gpu *gpu, struct drm_printer *p)
>  		drm_printf(p, "  %02x: %08x\n", i,
>  			gpu_read(gpu, REG_A5XX_CP_ME_STAT_DATA));
>  	}
> -
> -	return 0;
>  }
>  
> -static int meq_print(struct msm_gpu *gpu, struct drm_printer *p)
> +static void meq_print(struct msm_gpu *gpu, struct drm_printer *p)
>  {
>  	int i;
>  
> @@ -52,11 +48,9 @@ static int meq_print(struct msm_gpu *gpu, struct drm_printer *p)
>  		drm_printf(p, "  %02x: %08x\n", i,
>  			gpu_read(gpu, REG_A5XX_CP_MEQ_DBG_DATA));
>  	}
> -
> -	return 0;
>  }
>  
> -static int roq_print(struct msm_gpu *gpu, struct drm_printer *p)
> +static void roq_print(struct msm_gpu *gpu, struct drm_printer *p)
>  {
>  	int i;
>  
> @@ -71,8 +65,6 @@ static int roq_print(struct msm_gpu *gpu, struct drm_printer *p)
>  		drm_printf(p, "  %02x: %08x %08x %08x %08x\n", i,
>  			val[0], val[1], val[2], val[3]);
>  	}
> -
> -	return 0;
>  }
>  
>  static int show(struct seq_file *m, void *arg)
> @@ -81,10 +73,11 @@ static int show(struct seq_file *m, void *arg)
>  	struct drm_device *dev = node->minor->dev;
>  	struct msm_drm_private *priv = dev->dev_private;
>  	struct drm_printer p = drm_seq_file_printer(m);
> -	int (*show)(struct msm_gpu *gpu, struct drm_printer *p) =
> +	void (*show)(struct msm_gpu *gpu, struct drm_printer *p) =
>  		node->info_ent->data;
>  
> -	return show(priv->gpu, &p);
> +	show(priv->gpu, &p);
> +	return 0;
>  }
>  
>  #define ENT(n) { .name = #n, .show = show, .data = n ##_print }
> -- 
> 2.26.2
> 
> _______________________________________________
> 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

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

end of thread, other threads:[~2020-08-17 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-14  8:17 [PATCH] drm/msm/adreno: remove return value of function XX_print Bernard Zhao
2020-08-17 17:26 ` [Freedreno] " Jordan Crouse

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).