Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp831755rwb; Thu, 19 Jan 2023 03:20:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXtTxP4bXLMUGvR0ErInlVAydx8SjB+eIkowauhs5rlQNAYasJ7zroknAE/nQZmIr4AmC2kq X-Received: by 2002:a17:907:c30c:b0:86e:a013:c269 with SMTP id tl12-20020a170907c30c00b0086ea013c269mr12488187ejc.9.1674127235285; Thu, 19 Jan 2023 03:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674127235; cv=none; d=google.com; s=arc-20160816; b=QLv9g7Dgi+oWBrL1b7UIfbxcW7hIrV/HwOqEmwuu/In7M2h3pWdo8Ii3mAt/c2Lbox ZrM4Iybda2hrUagqCl8anQxinbEtVOgvuw6RJdgct/doJWAs6+vs1KHYAn0xb2bMm//B vEjDhvTR27FFvXpSglxMNon/hf0GW3ZB55t4vHPwxDYO/s0Pm36ARW9IRrcx0kbF8Nrg 8N5Nw1C/PCTFGR3xf9M08wQdCD98LhaVPhZAZAMg+lxNufoI338I6KkfCf2ZMDO24X36 WEPrlPD47wlWjZ1jp8fc/3cayVaCYxqVuGjzN8Gzu/r89n3K+MvWZkzA1wVfMoMIaRHK 5eDQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd10-20020a1709076e0a00b0086b7f3397c1si21608923ejc.494.2023.01.19.03.20.22; Thu, 19 Jan 2023 03:20:35 -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 + 44 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 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); -- 2.33.0