Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1265028 > unrolled thread
| Started by | tip-bot for Masami Hiramatsu <tipbot@zytor.com> |
|---|---|
| First post | 2015-11-08 08:40 +0100 |
| Last post | 2015-11-08 08:40 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
[tip:perf/urgent] perf probe: Cleanup find_perf_probe_point_from_map to reduce redundancy tip-bot for Masami Hiramatsu <tipbot@zytor.com> - 2015-11-08 08:40 +0100
| From | tip-bot for Masami Hiramatsu <tipbot@zytor.com> |
|---|---|
| Date | 2015-11-08 08:40 +0100 |
| Subject | [tip:perf/urgent] perf probe: Cleanup find_perf_probe_point_from_map to reduce redundancy |
| Message-ID | <qssJY-5As-39@gated-at.bofh.it> |
Commit-ID: 0a62f6869f2768687af2c94d97f3b2fcf5b73367
Gitweb: http://git.kernel.org/tip/0a62f6869f2768687af2c94d97f3b2fcf5b73367
Author: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
AuthorDate: Fri, 6 Nov 2015 17:30:03 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 6 Nov 2015 10:47:33 -0300
perf probe: Cleanup find_perf_probe_point_from_map to reduce redundancy
In find_perf_probe_point_from_map(), the 'ret' variable is initialized
with -ENOENT but overwritten by the return code of
kernel_get_symbol_address_by_name(), and after that it is re-initialized
with -ENOENT again.
Setting ret=-ENOENT twice looks a bit redundant. This avoids the
overwriting and just returns -ENOENT if some error happens to simplify
the code.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Zefan Li <lizefan@huawei.com>
Link: http://lkml.kernel.org/n/tip-ufp1zgbktzmttcputozneomd@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/probe-event.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index e659c4f..03875f9 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -1895,9 +1895,8 @@ static int find_perf_probe_point_from_map(struct probe_trace_point *tp,
sym = map__find_symbol(map, addr, NULL);
} else {
if (tp->symbol && !addr) {
- ret = kernel_get_symbol_address_by_name(tp->symbol,
- &addr, true, false);
- if (ret < 0)
+ if (kernel_get_symbol_address_by_name(tp->symbol,
+ &addr, true, false) < 0)
goto out;
}
if (addr) {
@@ -1906,8 +1905,6 @@ static int find_perf_probe_point_from_map(struct probe_trace_point *tp,
}
}
- /* ret may has be overwritten so reset it */
- ret = -ENOENT;
if (!sym)
goto out;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top | Article view | linux.kernel
csiph-web