lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-o4977g6p9b3peak9ct6ef48q@git.kernel.org>
Date:   Mon, 13 Feb 2017 22:42:39 -0800
From:   tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     jolsa@...nel.org, linux-kernel@...r.kernel.org,
        adrian.hunter@...el.com, hpa@...or.com, acme@...hat.com,
        namhyung@...nel.org, dsahern@...il.com, tglx@...utronix.de,
        mingo@...nel.org, wangnan0@...wei.com
Subject: [tip:perf/core] perf tests record: No need to test an array against
 NULL

Commit-ID:  9ef6839bcce7ca944c1ace4a7247cf13ca92a28f
Gitweb:     http://git.kernel.org/tip/9ef6839bcce7ca944c1ace4a7247cf13ca92a28f
Author:     Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Mon, 13 Feb 2017 17:04:05 -0300
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
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 <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-o4977g6p9b3peak9ct6ef48q@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/tests/perf-record.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index 8f2e1de..541da7a 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -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;
 	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ