diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-02-13 22:52:15 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-02-13 23:22:34 +0300 |
commit | a7c3899c06865c75f8887f33d9043f6e8e780e71 (patch) | |
tree | 1ab6a7c9ad3f707ce5113cdd034ac0c53bc88a7e /tools/perf/util/machine.c | |
parent | d6195a6a2c247515d5832debb51c03a74dc3f8f6 (diff) | |
download | linux-a7c3899c06865c75f8887f33d9043f6e8e780e71.tar.xz |
perf symbols: No need to check if sym->name is NULL
As it is an array, so will always evaluate to 'true', as reported by
clang:
builtin-sched.c:2070:19: error: address of array 'sym->name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
if (sym && sym->name) {
~~ ~~~~~^~~~
1 warning generated.
So just ditch all those useless checks.
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-ydpm927col06paixb775jjx5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/machine.c')
-rw-r--r-- | tools/perf/util/machine.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 747a034d1ff3..a1043cf9b89c 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1565,7 +1565,7 @@ int machine__process_event(struct machine *machine, union perf_event *event, static bool symbol__match_regex(struct symbol *sym, regex_t *regex) { - if (sym->name && !regexec(regex, sym->name, 0, NULL, 0)) + if (!regexec(regex, sym->name, 0, NULL, 0)) return 1; return 0; } |