mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Junhao He <hejunhao3@huawei.com>
To: <will@kernel.org>, <linux-kernel@vger.kernel.org>,
	<jonathan.cameron@huawei.com>, <mark.rutland@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<zhangshaokun@hisilicon.com>, <catalin.marinas@arm.com>,
	<kernel-team@android.com>, <linuxarm@huawei.com>,
	<yangyicong@huawei.com>, <f.fangjian@huawei.com>,
	<shenyang39@huawei.com>, <prime.zeng@hisilicon.com>,
	<hejunhao3@huawei.com>
Subject: [PATCH 3/3] drivers/perf: hisi: Extract initialization of "cpa_pmu->pmu"
Date: Thu, 19 Jan 2023 18:03:07 +0800	[thread overview]
Message-ID: <20230119100307.3660-4-hejunhao3@huawei.com> (raw)
In-Reply-To: <20230119100307.3660-1-hejunhao3@huawei.com>

Use hisi_pmu_init() function to simplify initialization of "cpa_pmu->pmu".

Signed-off-by: Junhao He <hejunhao3@huawei.com>
---
 drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c b/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c
index a9bb73f76be4..4c67d57217a7 100644
--- a/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c
@@ -316,21 +316,7 @@ static int hisi_cpa_pmu_probe(struct platform_device *pdev)
 	if (!name)
 		return -ENOMEM;
 
-	cpa_pmu->pmu = (struct pmu) {
-		.name		= name,
-		.module		= THIS_MODULE,
-		.task_ctx_nr	= perf_invalid_context,
-		.event_init	= hisi_uncore_pmu_event_init,
-		.pmu_enable	= hisi_uncore_pmu_enable,
-		.pmu_disable	= hisi_uncore_pmu_disable,
-		.add		= hisi_uncore_pmu_add,
-		.del		= hisi_uncore_pmu_del,
-		.start		= hisi_uncore_pmu_start,
-		.stop		= hisi_uncore_pmu_stop,
-		.read		= hisi_uncore_pmu_read,
-		.attr_groups	= cpa_pmu->pmu_events.attr_groups,
-		.capabilities	= PERF_PMU_CAP_NO_EXCLUDE,
-	};
+	hisi_pmu_init(cpa_pmu, name, THIS_MODULE);
 
 	/* Power Management should be disabled before using CPA PMU. */
 	hisi_cpa_pmu_disable_pm(cpa_pmu);
-- 
2.33.0


  parent reply	other threads:[~2023-01-19 10:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19 10:03 [PATCH 0/3] Setting the pmu::capability and modify some code styles Junhao He
2023-01-19 10:03 ` [PATCH 1/3] drivers/perf: hisi: Advertise the PERF_PMU_CAP_NO_EXCLUDE capability Junhao He
2023-01-19 10:03 ` [PATCH 2/3] drivers/perf: hisi: Simplify the parameters of hisi_pmu_init() Junhao He
2023-01-19 10:03 ` Junhao He [this message]
2023-01-19 19:08 ` [PATCH 0/3] Setting the pmu::capability and modify some code styles Will Deacon

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=20230119100307.3660-4-hejunhao3@huawei.com \
    --to=hejunhao3@huawei.com \
    --cc=catalin.marinas@arm.com \
    --cc=f.fangjian@huawei.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kernel-team@android.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=prime.zeng@hisilicon.com \
    --cc=shenyang39@huawei.com \
    --cc=will@kernel.org \
    --cc=yangyicong@huawei.com \
    --cc=zhangshaokun@hisilicon.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®