* [PATCH] tools: Optimize the variable with 0 as the return value
@ 2023-06-19 11:20 Li Dong
2023-06-19 12:48 ` Adrian Hunter
0 siblings, 1 reply; 2+ messages in thread
From: Li Dong @ 2023-06-19 11:20 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
Ian Rogers, Adrian Hunter, Andi Kleen, Steinar H. Gunderson,
open list:PERFORMANCE EVENTS SUBSYSTEM,
open list:PERFORMANCE EVENTS SUBSYSTEM
Cc: opensource.kernel, lidong
The variable ret is not used, replacing ret with 0 as the return value
Signed-off-by: Li Dong <lidong@vivo.com>
---
tools/perf/util/intel-pt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index dbf0bc71a63b..a40017458185 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -3398,7 +3398,6 @@ static int intel_pt_text_poke(struct intel_pt *pt, union perf_event *event)
struct machine *machine = pt->machine;
struct intel_pt_cache_entry *e;
u64 offset;
- int ret = 0;
addr_location__init(&al);
if (!event->text_poke.new_len)
@@ -3439,7 +3438,7 @@ static int intel_pt_text_poke(struct intel_pt *pt, union perf_event *event)
}
out:
addr_location__exit(&al);
- return ret;
+ return 0;
}
static int intel_pt_process_event(struct perf_session *session,
--
2.31.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tools: Optimize the variable with 0 as the return value
2023-06-19 11:20 [PATCH] tools: Optimize the variable with 0 as the return value Li Dong
@ 2023-06-19 12:48 ` Adrian Hunter
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Hunter @ 2023-06-19 12:48 UTC (permalink / raw)
To: Li Dong, Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
Ian Rogers, Andi Kleen, Steinar H. Gunderson,
open list:PERFORMANCE EVENTS SUBSYSTEM,
open list:PERFORMANCE EVENTS SUBSYSTEM
Cc: opensource.kernel
On 19/06/23 14:20, Li Dong wrote:
> The variable ret is not used, replacing ret with 0 as the return value
What kernel does that apply to?
>
> Signed-off-by: Li Dong <lidong@vivo.com>
> ---
> tools/perf/util/intel-pt.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
> index dbf0bc71a63b..a40017458185 100644
> --- a/tools/perf/util/intel-pt.c
> +++ b/tools/perf/util/intel-pt.c
> @@ -3398,7 +3398,6 @@ static int intel_pt_text_poke(struct intel_pt *pt, union perf_event *event)
> struct machine *machine = pt->machine;
> struct intel_pt_cache_entry *e;
> u64 offset;
> - int ret = 0;
>
> addr_location__init(&al);
> if (!event->text_poke.new_len)
> @@ -3439,7 +3438,7 @@ static int intel_pt_text_poke(struct intel_pt *pt, union perf_event *event)
> }
> out:
> addr_location__exit(&al);
> - return ret;
> + return 0;
> }
>
> static int intel_pt_process_event(struct perf_session *session,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-19 12:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-19 11:20 [PATCH] tools: Optimize the variable with 0 as the return value Li Dong
2023-06-19 12:48 ` Adrian Hunter
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).