lkml.org 
[lkml]   [2016]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf evsel: remove redundant check of field being non-null
Date
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
\
 
 \ /
  Last update: 2016-09-17 09:56    [W:0.029 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site