summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/builtin-test.c
diff options
context:
space:
mode:
authorYang Jihong <yangjihong1@huawei.com>2022-12-20 04:57:01 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-12-20 19:16:33 +0100
commit7c0a6144f9a6a53b1cf2f78f09ca35d59d267f1e (patch)
treefc29eb2def3ec95743617173879c8e93d05c7ec3 /tools/perf/tests/builtin-test.c
parentperf debug: Set debug_peo_args and redirect_to_stderr variable to correct val... (diff)
downloadlinux-7c0a6144f9a6a53b1cf2f78f09ca35d59d267f1e.tar.xz
linux-7c0a6144f9a6a53b1cf2f78f09ca35d59d267f1e.zip
perf tools: Fix usage of the verbose variable
The data type of the verbose variable is integer and can be negative, replace improperly used cases in a unified manner: 1. if (verbose) => if (verbose > 0) 2. if (!verbose) => if (verbose <= 0) 3. if (XX && verbose) => if (XX && verbose > 0) 4. if (XX && !verbose) => if (XX && verbose <= 0) Reviewed-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Yang Jihong <yangjihong1@huawei.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Carsten Haitzler <carsten.haitzler@arm.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Martin KaFai Lau <martin.lau@kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@amd.com> Link: https://lore.kernel.org/r/20221220035702.188413-3-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/builtin-test.c')
-rw-r--r--tools/perf/tests/builtin-test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index f6c16ad8ed50..cfa61493c750 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -305,7 +305,7 @@ static int shell_test__run(struct test_suite *test, int subdir __maybe_unused)
path__join(script, sizeof(script) - 3, st->dir, st->file);
- if (verbose)
+ if (verbose > 0)
strncat(script, " -v", sizeof(script) - strlen(script) - 1);
err = system(script);