Skip to content

Commit 6066622

Browse files
Jiapeng Chongacmel
authored andcommitted
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 <[email protected]> Signed-off-by: Jiapeng Chong <[email protected]> Suggested-by: David Laight <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Andrii Nakryiko <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Fastabend <[email protected]> Cc: KP Singh <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Martin KaFai Lau <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Song Liu <[email protected]> Cc: Yonghong Song <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/r/1614247483-102665-1-git-send-email-jiapeng.chong@linux.alibaba.com Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 0bb80ec commit 6066622

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tools/perf/util/machine.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,9 +2213,7 @@ int machine__process_event(struct machine *machine, union perf_event *event,
22132213

22142214
static bool symbol__match_regex(struct symbol *sym, regex_t *regex)
22152215
{
2216-
if (!regexec(regex, sym->name, 0, NULL, 0))
2217-
return true;
2218-
return false;
2216+
return regexec(regex, sym->name, 0, NULL, 0) == 0;
22192217
}
22202218

22212219
static void ip__resolve_ams(struct thread *thread,

0 commit comments

Comments
 (0)