From patchwork Thu Jan 19 10:03:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hejunhao X-Patchwork-Id: 45675 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp245536wrn; Thu, 19 Jan 2023 02:16:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXtX3ycBr6pEpmjsF0ZY5VfNSnaAtH6Gpuv5ngVTPQs4inMRqpH5CpcxdjsXM3adoGkmsYH8 X-Received: by 2002:a17:902:b18d:b0:18e:8223:6447 with SMTP id s13-20020a170902b18d00b0018e82236447mr10452207plr.22.1674123418782; Thu, 19 Jan 2023 02:16:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674123418; cv=none; d=google.com; s=arc-20160816; b=UOe8fwUaQALN+zha2rWUJ0HKoGpdYHrWOSN4g9/RdY+RgCYFpY+yPARnJB4K+Y2FY4 R4ZZZAm56RAZ6PuKXpCdhMTCeKc1UIssl6wE5tvSJiD3sj1LQqg5qCSv/O0ZeebVTdW7 FrROsUCFmpAB1+a+XUdRKQ7wDAcXSzA2EsMBShBZrWaXSPoyB6YGrM2pJe5yywBUUwF1 WQw2+OMBN12UR/xn98/55yIvyszZUpgGQ9KB/kHLWEEUv9if9TukCEfKu6a7bNwhrkv+ En3eDVSX/EodsoJSB2BCLoTQIs22qj4ajC/hNg21rCjufSiy34m86Kmx2kGNXagQjs8R to0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JqedcLtW32/d10py4N9mdRi/FIAOOy3wSjfBJ+Dc0bA=; b=C5BDfY77kqEVS0M04bc+G7IwXjtF7HUCgfc7PoLzaCsxXNvh4zX5z4nf5XjkUUuwYR BRUQ7ByXwvWyJkcqPwiZjhZe7jj5Nn0aidgXbAEPTSqFGNi/vuK4g0DEU7hCh9pWrI8/ dFPdETGArhOTyjfI7mM20CZih9+E8kC7mg52Q/yCHNER++NAX2OMtgu4ckE8OP3VkqNi QdZs+y3DnTlo256ZOU0zBd5ixubXlzu2qhV6V643T5POHuPHFiR4HWwmsROv/3jR59MO FBAxSrfVLL8p3jVW+C6NSvOyLzLutT8s+9epMurIyZaI13qCBJrSW5NPgdi/OVD9aOTV iXkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c2-20020a170902f30200b001924febcabcsi12511169ple.420.2023.01.19.02.16.45; Thu, 19 Jan 2023 02:16:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230327AbjASKFe (ORCPT + 99 others); Thu, 19 Jan 2023 05:05:34 -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 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755445638234036452?= X-GMAIL-MSGID: =?utf-8?q?1755445638234036452?= 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/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);