Skip to content

Commit 9ef6839

Browse files
committed
perf tests record: No need to test an array against NULL
It will always evaluate to 'true', as clang warns: CC /tmp/build/perf/tests/perf-record.o CC /tmp/build/perf/tests/evsel-roundtrip-name.o tests/perf-record.c:69:24: error: comparison of array 'argv' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare] if (evlist == NULL || argv == NULL) { ^~~~ ~~~~ 1 error generated. Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Wang Nan <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent a7c3899 commit 9ef6839

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/tests/perf-record.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ int test__PERF_RECORD(int subtest __maybe_unused)
6666
if (evlist == NULL) /* Fallback for kernels lacking PERF_COUNT_SW_DUMMY */
6767
evlist = perf_evlist__new_default();
6868

69-
if (evlist == NULL || argv == NULL) {
69+
if (evlist == NULL) {
7070
pr_debug("Not enough memory to create evlist\n");
7171
goto out;
7272
}

0 commit comments

Comments
 (0)