[PATCH v2 02/10] perf trace: Change some comments

Howard Chu posted 10 patches 1 year, 5 months ago
There is a newer version of this series
[PATCH v2 02/10] perf trace: Change some comments
Posted by Howard Chu 1 year, 5 months ago
Change them from '//' to '/* */'

Signed-off-by: Howard Chu <howardchu95@gmail.com>
---
 tools/perf/builtin-trace.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index d6ca541fdc78..97076b962688 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -957,17 +957,16 @@ static bool syscall_arg__strtoul_btf_type(char *bf, size_t size, struct syscall_
 	if (btf == NULL)
 		return false;
 
-	if (arg->fmt->type == NULL) {
-		// See if this is an enum
+	/* See if this is an enum */
+	if (arg->fmt->type == NULL)
 		syscall_arg_fmt__cache_btf_enum(arg->fmt, btf, type);
-	}
 
-	// Now let's see if we have a BTF type resolved
+	/* Now let's see if we have a BTF type resolved */
 	bt = arg->fmt->type;
 	if (bt == NULL)
 		return false;
 
-	// If it is an enum:
+	/* If it is an enum: */
 	if (btf_is_enum(arg->fmt->type))
 		return syscall_arg__strtoul_btf_enum(bf, size, arg, val);
 
-- 
2.45.2
Re: [PATCH v2 02/10] perf trace: Change some comments
Posted by Arnaldo Carvalho de Melo 1 year, 5 months ago
On Thu, Aug 15, 2024 at 09:36:18AM +0800, Howard Chu wrote:
> Change them from '//' to '/* */'

You didn't state why you did it, is it to follow coding styles? IIRC //
is acceptable.

- Arnaldo
 
> Signed-off-by: Howard Chu <howardchu95@gmail.com>
> ---
>  tools/perf/builtin-trace.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> index d6ca541fdc78..97076b962688 100644
> --- a/tools/perf/builtin-trace.c
> +++ b/tools/perf/builtin-trace.c
> @@ -957,17 +957,16 @@ static bool syscall_arg__strtoul_btf_type(char *bf, size_t size, struct syscall_
>  	if (btf == NULL)
>  		return false;
>  
> -	if (arg->fmt->type == NULL) {
> -		// See if this is an enum
> +	/* See if this is an enum */
> +	if (arg->fmt->type == NULL)
>  		syscall_arg_fmt__cache_btf_enum(arg->fmt, btf, type);
> -	}
>  
> -	// Now let's see if we have a BTF type resolved
> +	/* Now let's see if we have a BTF type resolved */
>  	bt = arg->fmt->type;
>  	if (bt == NULL)
>  		return false;
>  
> -	// If it is an enum:
> +	/* If it is an enum: */
>  	if (btf_is_enum(arg->fmt->type))
>  		return syscall_arg__strtoul_btf_enum(bf, size, arg, val);
>  
> -- 
> 2.45.2
>