perf tests record: No need to test an array against NULL
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: 9ef6839bcce7ca944c1ace4a7247cf13ca92a28f Gitweb: http://git.kernel.org/tip/9ef6839bcce7ca944c1ace4a7247cf13ca92a28f Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Mon, 13 Feb 2017 17:04:05 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 13 Feb 2017 17:22:34 -0300
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]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/tests/perf-record.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/perf-record.c +1 -1
@@ -66,7 +66,7 @@ int test__PERF_RECORD(int subtest __maybe_unused)if (evlist ==NULL )/* Fallback for kernels lacking PERF_COUNT_SW_DUMMY */ evlist =perf_evlist__new_default (); -if (evlist ==NULL || argv ==NULL ) { +if (evlist ==NULL ) {pr_debug ("Not enough memory to create evlist\n" ); goto out; }