diff options
author | Jiapeng Chong <jiapeng.chong@linux.alibaba.com> | 2021-02-25 11:04:43 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-09-11 15:26:35 +0200 |
commit | 6066622c97cc0b25d287dc859dbe5f185740e0b4 (patch) | |
tree | 16251ff606cce0c76eedd6253072429667a1d5f9 /tools | |
parent | Linux 6.6-rc1 (diff) | |
download | linux-6066622c97cc0b25d287dc859dbe5f185740e0b4.tar.xz linux-6066622c97cc0b25d287dc859dbe5f185740e0b4.zip |
perf machine: Use true and false for bool variable
Fix the following coccicheck warnings:
./tools/perf/util/machine.c:2000:9-10: WARNING: return of 0/1 in
function 'symbol__match_regex' with return type bool.
Committer notes:
Found this in the pile, it was already returning bool, but this patch
simplifies it further, from 3 lines to just 1.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Suggested-by: David Laight <David.Laight@ACULAB.COM>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: bpf@vger.kernel.org
Cc: netdev@vger.kernel.org
Link: https://lore.kernel.org/r/1614247483-102665-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/machine.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 88f31b3a63ac..addfae2f63ef 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -2213,9 +2213,7 @@ int machine__process_event(struct machine *machine, union perf_event *event, static bool symbol__match_regex(struct symbol *sym, regex_t *regex) { - if (!regexec(regex, sym->name, 0, NULL, 0)) - return true; - return false; + return regexec(regex, sym->name, 0, NULL, 0) == 0; } static void ip__resolve_ams(struct thread *thread, |