From nobody Sun Sep 14 20:23:20 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDCB9C004D4 for ; Thu, 19 Jan 2023 10:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229482AbjASKFf (ORCPT ); Thu, 19 Jan 2023 05:05:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230287AbjASKEc (ORCPT ); Thu, 19 Jan 2023 05:04:32 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA060717A8 for ; Thu, 19 Jan 2023 02:03:34 -0800 (PST) Received: from dggpeml500002.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NyJ7W71rHz16MlY; Thu, 19 Jan 2023 18:01:43 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggpeml500002.china.huawei.com (7.185.36.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 19 Jan 2023 18:03:28 +0800 From: Junhao He To: , , , CC: , , , , , , , , , Subject: [PATCH 3/3] drivers/perf: hisi: Extract initialization of "cpa_pmu->pmu" Date: Thu, 19 Jan 2023 18:03:07 +0800 Message-ID: <20230119100307.3660-4-hejunhao3@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230119100307.3660-1-hejunhao3@huawei.com> References: <20230119100307.3660-1-hejunhao3@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500002.china.huawei.com (7.185.36.158) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use hisi_pmu_init() function to simplify initialization of "cpa_pmu->pmu". Signed-off-by: Junhao He --- 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/hi= silicon/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; =20 - cpa_pmu->pmu =3D (struct pmu) { - .name =3D name, - .module =3D THIS_MODULE, - .task_ctx_nr =3D perf_invalid_context, - .event_init =3D hisi_uncore_pmu_event_init, - .pmu_enable =3D hisi_uncore_pmu_enable, - .pmu_disable =3D hisi_uncore_pmu_disable, - .add =3D hisi_uncore_pmu_add, - .del =3D hisi_uncore_pmu_del, - .start =3D hisi_uncore_pmu_start, - .stop =3D hisi_uncore_pmu_stop, - .read =3D hisi_uncore_pmu_read, - .attr_groups =3D cpa_pmu->pmu_events.attr_groups, - .capabilities =3D PERF_PMU_CAP_NO_EXCLUDE, - }; + hisi_pmu_init(cpa_pmu, name, THIS_MODULE); =20 /* Power Management should be disabled before using CPA PMU. */ hisi_cpa_pmu_disable_pm(cpa_pmu); --=20 2.33.0