diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-02-13 23:11:03 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-02-13 23:22:35 +0300 |
commit | 5eae7d842510d33d4410c062280eda6c935403dd (patch) | |
tree | 3761779adda8056d41ac3d203e2a9be1194d9db8 /tools/perf/util/map.c | |
parent | 9ef6839bcce7ca944c1ace4a7247cf13ca92a28f (diff) | |
download | linux-5eae7d842510d33d4410c062280eda6c935403dd.tar.xz |
perf symbols: dso->name is an array, no need to check it against NULL
As it will always evaluate to 'true', as reported by clang:
util/map.c:390:36: error: address of array 'map->dso->name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
if (map && map->dso && (map->dso->name || map->dso->long_name)) {
~~~~~~~~~~^~~~ ~~
util/map.c:393:22: error: address of array 'map->dso->name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
else if (map->dso->name)
~~ ~~~~~~~~~~^~~~
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-x8cu007cly40kfp8xnpi9kya@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r-- | tools/perf/util/map.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 4f9a71c63026..0a943e7b1ea7 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -387,10 +387,10 @@ size_t map__fprintf_dsoname(struct map *map, FILE *fp) { const char *dsoname = "[unknown]"; - if (map && map->dso && (map->dso->name || map->dso->long_name)) { + if (map && map->dso) { if (symbol_conf.show_kernel_path && map->dso->long_name) dsoname = map->dso->long_name; - else if (map->dso->name) + else dsoname = map->dso->name; } |