]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
perf probe: Use return of map__get() to make code more compact
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 24 May 2018 14:17:34 +0000 (11:17 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 4 Jun 2018 13:28:50 +0000 (10:28 -0300)
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>
tools/perf/util/probe-event.c

index 3094f11e7d81573f6f051b75ea212dc36ffc9893..f119eb628dbb6974e60effa3ae7f766d23164194 100644 (file)
@@ -165,8 +165,7 @@ static struct map *kernel_get_module_map(const char *module)
                if (strncmp(pos->dso->short_name + 1, module,
                            pos->dso->short_name_len - 2) == 0 &&
                    module[pos->dso->short_name_len - 2] == '\0') {
-                       map__get(pos);
-                       return pos;
+                       return map__get(pos);
                }
        }
        return NULL;