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


Groups > linux.kernel > #1462122

[PATCH] perf evsel: remove redundant check of field being non-null

Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.us.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Colin King <colin.king@canonical.com>
Newsgroups linux.kernel
Subject [PATCH] perf evsel: remove redundant check of field being non-null
Date Sun, 14 Aug 2016 15:20:01 +0200
Message-ID <s63ux-83-7@gated-at.bofh.it> (permalink)
X-Original-To Ingo Molnar <mingo@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Arnaldo Carvalho de Melo <acme@kernel.org>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Wang Nan <wangnan0@huawei.com>
X-Mailer git-send-email 2.8.1
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 26
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org
X-Original-Date Sat, 13 Aug 2016 19:41:02 +0100
X-Original-Message-ID <1471113662-20025-1-git-send-email-colin.king@canonical.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1462122

Show key headers only | View raw


From: Colin Ian King <colin.king@canonical.com>

The check if field is non-null in the ternary operator is
redundant since this check is made in the previousl if statement.
Remove this redundant check.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 tools/perf/util/evsel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index d9b80ef..f4b1206 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2341,7 +2341,7 @@ u64 perf_evsel__intval(struct perf_evsel *evsel, struct perf_sample *sample,
 	if (!field)
 		return 0;
 
-	return field ? format_field__intval(field, sample, evsel->needs_swap) : 0;
+	return format_field__intval(field, sample, evsel->needs_swap);
 }
 
 bool perf_evsel__fallback(struct perf_evsel *evsel, int err,
-- 
2.8.1

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


Thread

[PATCH] perf evsel: remove redundant check of field being non-null Colin King <colin.king@canonical.com> - 2016-08-14 15:20 +0200

csiph-web