linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] perf evsel: Remove duplicate check for `field` in evsel__intval()
  2023-08-15 22:10 [PATCH] perf evsel: Remove duplicate check for `field` in evsel__intval() Yang Jihong
@ 2023-08-15 17:43 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-08-15 17:43 UTC (permalink / raw)
  To: Yang Jihong
  Cc: peterz, mingo, mark.rutland, alexander.shishkin, jolsa, namhyung,
	irogers, adrian.hunter, kan.liang, sandipan.das, ravi.bangoria,
	linux-perf-users, linux-kernel

Em Tue, Aug 15, 2023 at 10:10:09PM +0000, Yang Jihong escreveu:
> The `file` parameter in evsel__intval() is checked repeatedly, fix it.
> 
> No functional change.

Thanks, applied.

- Arnaldo

 
> Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
> ---
>  tools/perf/util/evsel.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> index e41bc4d9925f..0c50c443d456 100644
> --- a/tools/perf/util/evsel.c
> +++ b/tools/perf/util/evsel.c
> @@ -2827,9 +2827,6 @@ u64 evsel__intval(struct evsel *evsel, struct perf_sample *sample, const char *n
>  {
>  	struct tep_format_field *field = evsel__field(evsel, name);
>  
> -	if (!field)
> -		return 0;
> -
>  	return field ? format_field__intval(field, sample, evsel->needs_swap) : 0;
>  }
>  #endif
> -- 
> 2.39.2
> 

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] perf evsel: Remove duplicate check for `field` in evsel__intval()
@ 2023-08-15 22:10 Yang Jihong
  2023-08-15 17:43 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Jihong @ 2023-08-15 22:10 UTC (permalink / raw)
  To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, irogers, adrian.hunter, kan.liang, sandipan.das,
	ravi.bangoria, linux-perf-users, linux-kernel
  Cc: yangjihong1

The `file` parameter in evsel__intval() is checked repeatedly, fix it.

No functional change.

Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
---
 tools/perf/util/evsel.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index e41bc4d9925f..0c50c443d456 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2827,9 +2827,6 @@ u64 evsel__intval(struct evsel *evsel, struct perf_sample *sample, const char *n
 {
 	struct tep_format_field *field = evsel__field(evsel, name);
 
-	if (!field)
-		return 0;
-
 	return field ? format_field__intval(field, sample, evsel->needs_swap) : 0;
 }
 #endif
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-15 17:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-15 22:10 [PATCH] perf evsel: Remove duplicate check for `field` in evsel__intval() Yang Jihong
2023-08-15 17:43 ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).