mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
perf probe: Use return of map__get() to make code more compact
The __get() idiom returns a reference count for the object passed, i.e. all functions of this type return the object passed, so take advantage of that to make the code more compact. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-ds6vdm7clh070512rpydidsc@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
4f5aeecd0d
commit
f622df5ed7
1 changed files with 1 additions and 2 deletions
|
@ -165,8 +165,7 @@ static struct map *kernel_get_module_map(const char *module)
|
||||||
if (strncmp(pos->dso->short_name + 1, module,
|
if (strncmp(pos->dso->short_name + 1, module,
|
||||||
pos->dso->short_name_len - 2) == 0 &&
|
pos->dso->short_name_len - 2) == 0 &&
|
||||||
module[pos->dso->short_name_len - 2] == '\0') {
|
module[pos->dso->short_name_len - 2] == '\0') {
|
||||||
map__get(pos);
|
return map__get(pos);
|
||||||
return pos;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue