perf tools: No need to check if the argument to __get() function is NULL
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: 362379aad56fdc627a49e30d12c3ece900221898 Gitweb: https://git.kernel.org/tip/362379aad56fdc627a49e30d12c3ece900221898 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Thu, 24 May 2018 11:20:39 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 4 Jun 2018 10:28:50 -0300
perf tools: No need to check if the argument to __get() function is NULL
Those functions always check if the argument is NULL before trying to grab a reference count, and also will return the received object, so, to make code more compact, no need to check for NULL.
Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Krister Johansen <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Wang Nan <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/builtin-probe.c | 3 +-- tools/perf/util/hist.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
tools/perf/builtin-probe.c +1 -2
@@ -81,8 +81,7 @@ static int parse_probe_event(const char *str) params.target_used = true; } -if (params.nsi) - pev->nsi =nsinfo__get (params.nsi); + pev->nsi =nsinfo__get (params.nsi);/* Parse a perf-probe command into event */ ret =parse_perf_probe_command (str, pev);
tools/perf/util/hist.c +1 -1
@@ -1039,7 +1039,7 @@ int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al,int err, err2;struct map *alm =NULL ; -if (al && al->map) +if (al) alm =map__get (al->map); err = sample__resolve_callchain(iter->sample, &callchain_cursor, &iter->parent,