linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] tools: perf: convert comma to semicolon
@ 2020-12-16 13:15 Zheng Yongjun
  2020-12-17 17:19 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-16 13:15 UTC (permalink / raw)
  To: mark.rutland, alexander.shishkin, linux-kernel; +Cc: Zheng Yongjun

Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 tools/perf/builtin-diff.c         | 4 ++--
 tools/perf/builtin-inject.c       | 2 +-
 tools/perf/ui/browsers/annotate.c | 2 +-
 tools/perf/util/annotate.c        | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index cefc71506409..9064419b108f 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -1912,8 +1912,8 @@ static int data_init(int argc, const char **argv)
 		struct perf_data *data = &d->data;
 
 		data->path  = use_default ? defaults[i] : argv[i];
-		data->mode  = PERF_DATA_MODE_READ,
-		data->force = force,
+		data->mode  = PERF_DATA_MODE_READ;
+		data->force = force;
 
 		d->idx  = i;
 	}
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 0462dc8db2e3..235a91a907fd 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -747,7 +747,7 @@ static int __cmd_inject(struct perf_inject *inject)
 		inject->tool.auxtrace_info  = perf_event__process_auxtrace_info;
 		inject->tool.auxtrace	    = perf_event__process_auxtrace;
 		inject->tool.aux	    = perf_event__drop_aux;
-		inject->tool.itrace_start   = perf_event__drop_aux,
+		inject->tool.itrace_start   = perf_event__drop_aux;
 		inject->tool.ordered_events = true;
 		inject->tool.ordering_requires_timestamps = true;
 		/* Allow space in the header for new attributes */
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index bd77825fd5a1..3d857b1e0e62 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -928,7 +928,7 @@ int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
 
 	browser.b.width = notes->max_line_len;
 	browser.b.nr_entries = notes->nr_entries;
-	browser.b.entries = &notes->src->source,
+	browser.b.entries = &notes->src->source;
 	browser.b.width += 18; /* Percentage */
 
 	if (notes->options->hide_src_code)
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 6c8575e182ed..3b4663f8229e 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -367,7 +367,7 @@ static int jump__parse(struct arch *arch, struct ins_operands *ops, struct map_s
 	}
 
 	target.addr = map__objdump_2mem(map, ops->target.addr);
-	start = map->unmap_ip(map, sym->start),
+	start = map->unmap_ip(map, sym->start);
 	end = map->unmap_ip(map, sym->end);
 
 	ops->target.outside = target.addr < start || target.addr > end;
-- 
2.22.0


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

* Re: [PATCH -next] tools: perf: convert comma to semicolon
  2020-12-16 13:15 [PATCH -next] tools: perf: convert comma to semicolon Zheng Yongjun
@ 2020-12-17 17:19 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2020-12-17 17:19 UTC (permalink / raw)
  To: Zheng Yongjun, mark.rutland, alexander.shishkin, linux-kernel
  Cc: Julia Lawall

On Wed, 2020-12-16 at 21:15 +0800, Zheng Yongjun wrote:
> Replace a comma between expression statements by a semicolon.

If you are going to submit patches for comma/semicolon conversions,
please to not use checkpatch to produce them.

checkpatch is a trivial tool that does not have very good coverage
of the possible uses of commas that would generally be written with
a semicolon.

Use the coccinelle script that Julia Lawall provided instead.

https://lore.kernel.org/lkml/alpine.DEB.2.22.394.2008201856110.2524@hadrien/

This misses these 2 uses in tools/perf.

diff --git a/tools/perf/ui/tui/util.c b/tools/perf/ui/tui/util.c
index 0f562e2cb1e8..ee549b07b9ae 100644
--- a/tools/perf/ui/tui/util.c
+++ b/tools/perf/ui/tui/util.c
@@ -190,7 +190,7 @@ void __ui__info_window(const char *title, const char *text,>
        nr_lines += 2;
        if (exit_msg)
                nr_lines += 2;
-       y = SLtt_Screen_Rows / 2 - nr_lines / 2,
+       y = SLtt_Screen_Rows / 2 - nr_lines / 2;
        x = SLtt_Screen_Cols / 2 - max_len / 2;
 
        SLsmg_set_color(0);

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 1cad6051d8b0..76abb08f9e14 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -269,7 +269,7 @@ struct evsel *evsel__new_idx(struct perf_event_attr *attr, int idx)
 
        if (evsel__is_bpf_output(evsel)) {
                evsel->core.attr.sample_type |= (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME |
-                                           PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD),
+                                           PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD);
                evsel->core.attr.sample_period = 1;
        }
 


> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
>  tools/perf/builtin-diff.c         | 4 ++--
>  tools/perf/builtin-inject.c       | 2 +-
>  tools/perf/ui/browsers/annotate.c | 2 +-
>  tools/perf/util/annotate.c        | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
> index cefc71506409..9064419b108f 100644
> --- a/tools/perf/builtin-diff.c
> +++ b/tools/perf/builtin-diff.c
> @@ -1912,8 +1912,8 @@ static int data_init(int argc, const char **argv)
>  		struct perf_data *data = &d->data;
>  
> 
>  		data->path  = use_default ? defaults[i] : argv[i];
> -		data->mode  = PERF_DATA_MODE_READ,
> -		data->force = force,
> +		data->mode  = PERF_DATA_MODE_READ;
> +		data->force = force;
>  
> 
>  		d->idx  = i;
>  	}
> diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
> index 0462dc8db2e3..235a91a907fd 100644
> --- a/tools/perf/builtin-inject.c
> +++ b/tools/perf/builtin-inject.c
> @@ -747,7 +747,7 @@ static int __cmd_inject(struct perf_inject *inject)
>  		inject->tool.auxtrace_info  = perf_event__process_auxtrace_info;
>  		inject->tool.auxtrace	    = perf_event__process_auxtrace;
>  		inject->tool.aux	    = perf_event__drop_aux;
> -		inject->tool.itrace_start   = perf_event__drop_aux,
> +		inject->tool.itrace_start   = perf_event__drop_aux;
>  		inject->tool.ordered_events = true;
>  		inject->tool.ordering_requires_timestamps = true;
>  		/* Allow space in the header for new attributes */
> diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
> index bd77825fd5a1..3d857b1e0e62 100644
> --- a/tools/perf/ui/browsers/annotate.c
> +++ b/tools/perf/ui/browsers/annotate.c
> @@ -928,7 +928,7 @@ int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
>  
> 
>  	browser.b.width = notes->max_line_len;
>  	browser.b.nr_entries = notes->nr_entries;
> -	browser.b.entries = &notes->src->source,
> +	browser.b.entries = &notes->src->source;
>  	browser.b.width += 18; /* Percentage */
>  
> 
>  	if (notes->options->hide_src_code)
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index 6c8575e182ed..3b4663f8229e 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -367,7 +367,7 @@ static int jump__parse(struct arch *arch, struct ins_operands *ops, struct map_s
>  	}
>  
> 
>  	target.addr = map__objdump_2mem(map, ops->target.addr);
> -	start = map->unmap_ip(map, sym->start),
> +	start = map->unmap_ip(map, sym->start);
>  	end = map->unmap_ip(map, sym->end);
>  
> 
>  	ops->target.outside = target.addr < start || target.addr > end;



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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 13:15 [PATCH -next] tools: perf: convert comma to semicolon Zheng Yongjun
2020-12-17 17:19 ` Joe Perches

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