From 8524711d2cf3072d28966e0c40811704e63139c6 Mon Sep 17 00:00:00 2001 From: Yang Li Date: Mon, 8 Feb 2021 16:45:36 +0800 Subject: [PATCH] perf script: Simplify bool conversion Fix the following coccicheck warning: ./tools/perf/builtin-script.c:2789:36-41: WARNING: conversion to bool not needed here ./tools/perf/builtin-script.c:3237:48-53: WARNING: conversion to bool not needed here Reported-by: Abaci Robot Signed-off-by: Yang Li Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Ingo Molnar Cc: John Fastabend Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Yonghong Song Link: https://lore.kernel.org/r/1612773936-98691-1-git-send-email-yang.lee@linux.alibaba.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 1ff7264..aef119b 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -2795,7 +2795,7 @@ parse: break; } if (i == imax && strcmp(tok, "flags") == 0) { - print_flags = change == REMOVE ? false : true; + print_flags = change != REMOVE; continue; } if (i == imax) { @@ -3243,7 +3243,7 @@ static char *get_script_path(const char *script_root, const char *suffix) static bool is_top_script(const char *script_path) { - return ends_with(script_path, "top") == NULL ? false : true; + return ends_with(script_path, "top") != NULL; } static int has_required_arg(char *script_path) -- 2.7.4