Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1580188

[PATCH 11/15] perf tests record: No need to test an array against NULL

Path csiph.com!1.us.feeder.erje.net!2.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 11/15] perf tests record: No need to test an array against NULL
Date Tue, 14 Feb 2017 02:20:03 +0100
Message-ID <tazWH-3d2-29@gated-at.bofh.it> (permalink)
References <tazWF-3d2-3@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/9P/ytmrWVbJ5Y2GUIecTjwD2DFQdIvKBUB1PU8Vlfo=; b=jru5E641ceveotgnMHMENOG8k xTBC06pxqYajw0so1HKr+Vjj38hBYrAmr2tq+BUBTConyFCvhz8QJ2G5uu5ONQaifT8yiTM+N3sUA TsDYSKhlBe53/orkR5SuzzCzdXt8HP5UoEUK+6TOONU+4VaSpNV05KdPWnhoK/fHMbkLER7SONqLA fq3Us/pL2K5+mis9BKrMUcd5mjIrcbt6yFHm4ZAuqvsjCJ8VV7UcOyjEYh2j2i7chPIHfr3OgwdvE zYDTK+HUGEh9B4oq99A4J8m7yRso3GgANG3n82rZINysLhnEh3jE5rSrpZkIycZn4s8i0dDXZzGfD 2wYndGjQw==;
X-Mailer git-send-email 2.9.3
X-Srs-Rewrite SMTP reverse-path rewritten from <acme@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 37
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo <acme@redhat.com>, Adrian Hunter <adrian.hunter@intel.com>, David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Wang Nan <wangnan0@huawei.com>
X-Original-Date Mon, 13 Feb 2017 22:13:56 -0300
X-Original-Message-ID <20170214011400.13352-12-acme@kernel.org>
X-Original-References <20170214011400.13352-1-acme@kernel.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1580188

Show key headers only | View raw


From: Arnaldo Carvalho de Melo <acme@redhat.com>

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@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-o4977g6p9b3peak9ct6ef48q@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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 8f2e1de6d0ea..541da7a68f91 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;
 	}
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-14 02:20 +0100
  [PATCH 04/15] perf diff: Add diff.compute config option Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-14 02:20 +0100
  [PATCH 11/15] perf tests record: No need to test an array against NULL Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-14 02:20 +0100
  [PATCH 08/15] tools lib traceevent plugin function: Initialize 'index' variable Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-14 02:20 +0100
  [PATCH 14/15] samples/bpf: Ignore already processed ELF sections Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-14 02:20 +0100
  [PATCH 01/15] tools include: Introduce linux/compiler-gcc.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-14 02:20 +0100
  [PATCH 07/15] tools lib traceevent: Initialize lenght on OLD_RING_BUFFER_TYPE_TIME_STAMP Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-14 02:20 +0100
  [PATCH 09/15] perf evsel: Inform how to make a sysctl setting permanent Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-02-14 02:20 +0100
  Re: [GIT PULL 00/15] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2017-02-14 07:40 +0100

csiph-web