Skip to contentSkip to conversation

tools: Optimize the variable with 0 as the return value

PATCH In review Li Dong 2 participants 2 messages Jun 19, 2023 perf events

lore
Share & tools
lore

Li Dong

author
#0 lore raw

PATCH 1/1 tools: Optimize the variable with 0 as the return value

The variable ret is not used, replacing ret with 0 as the return value

---
 tools/perf/util/intel-pt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/perf/util/intel-pt.c +1 -2
index dbf0bc71a63b..a40017458185 100644
@@ -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,
Signature · 1 line
2.31.1.windows.1
reviewer
#1 lore raw
Quoted 1 line · Li Dong

The variable ret is not used, replacing ret with 0 as the return value

What kernel does that apply to?

Quoted 27 lines
---
 tools/perf/util/intel-pt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/perf/util/intel-pt.c +1 -2
index dbf0bc71a63b..a40017458185 100644
@@ -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,