mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <zhang.songyi@zte.com.cn>
To: <peterz@infradead.org>, <zhengjun.xing@linux.intel.com>
Cc: <mingo@redhat.com>, <acme@kernel.org>, <mark.rutland@arm.com>,
	<alexander.shishkin@linux.intel.com>, <jolsa@kernel.org>,
	<namhyung@kernel.org>, <kan.liang@linux.intel.com>,
	<irogers@google.com>, <zhang.songyi@zte.com.cn>,
	<adrian.hunter@intel.com>, <linux-perf-users@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH linux-next] perf stat: remove redundant variable in
 arch_get_topdown_pmu_name
Date: Wed, 23 Nov 2022 17:00:50 +0800 (CST)	[thread overview]
Message-ID: <202211231700506267036@zte.com.cn> (raw)

From: zhang songyi <zhang.songyi@zte.com.cn>

Return value from arch_get_topdown_pmu_name directly instead of taking
this in another redundant variable.

Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
---
 tools/perf/arch/x86/util/topdown.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tools/perf/arch/x86/util/topdown.c b/tools/perf/arch/x86/util/topdown.c
index 54810f9acd6f..5a5cdd6efe4d 100644
--- a/tools/perf/arch/x86/util/topdown.c
+++ b/tools/perf/arch/x86/util/topdown.c
@@ -84,8 +84,6 @@ bool arch_topdown_sample_read(struct evsel *leader)

 const char *arch_get_topdown_pmu_name(struct evlist *evlist, bool warn)
 {
-       const char *pmu_name;
-
        if (!perf_pmu__has_hybrid())
                return "cpu";

@@ -95,9 +93,7 @@ const char *arch_get_topdown_pmu_name(struct evlist *evlist, bool warn)
                evlist->hybrid_pmu_name = perf_pmu__hybrid_type_to_pmu("core");
        }

-       pmu_name = evlist->hybrid_pmu_name;
-
-       return pmu_name;
+       return evlist->hybrid_pmu_name;
 }

 int topdown_parse_events(struct evlist *evlist)
--
2.15.2

             reply	other threads:[~2022-11-23  9:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23  9:00 zhang.songyi [this message]
2022-11-23 23:33 ` Ian Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202211231700506267036@zte.com.cn \
    --to=zhang.songyi@zte.com.cn \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=zhengjun.xing@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®