Commit 25d8c250 authored by Junhao He's avatar Junhao He Committed by Will Deacon

drivers/perf: hisi: Remove redundant initialized of pmu->name

"pmu->name" is initialized by perf_pmu_register() function, so remove
the redundant initialized in hisi_pmu_init().
Signed-off-by: default avatarJunhao He <hejunhao3@huawei.com>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20230403081423.62460-2-hejunhao3@huawei.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent 2ad91e44
...@@ -316,7 +316,7 @@ static int hisi_cpa_pmu_probe(struct platform_device *pdev) ...@@ -316,7 +316,7 @@ static int hisi_cpa_pmu_probe(struct platform_device *pdev)
if (!name) if (!name)
return -ENOMEM; return -ENOMEM;
hisi_pmu_init(cpa_pmu, name, THIS_MODULE); hisi_pmu_init(cpa_pmu, THIS_MODULE);
/* Power Management should be disabled before using CPA PMU. */ /* Power Management should be disabled before using CPA PMU. */
hisi_cpa_pmu_disable_pm(cpa_pmu); hisi_cpa_pmu_disable_pm(cpa_pmu);
......
...@@ -516,7 +516,7 @@ static int hisi_ddrc_pmu_probe(struct platform_device *pdev) ...@@ -516,7 +516,7 @@ static int hisi_ddrc_pmu_probe(struct platform_device *pdev)
"hisi_sccl%u_ddrc%u", ddrc_pmu->sccl_id, "hisi_sccl%u_ddrc%u", ddrc_pmu->sccl_id,
ddrc_pmu->index_id); ddrc_pmu->index_id);
hisi_pmu_init(ddrc_pmu, name, THIS_MODULE); hisi_pmu_init(ddrc_pmu, THIS_MODULE);
ret = perf_pmu_register(&ddrc_pmu->pmu, name, -1); ret = perf_pmu_register(&ddrc_pmu->pmu, name, -1);
if (ret) { if (ret) {
......
...@@ -519,7 +519,7 @@ static int hisi_hha_pmu_probe(struct platform_device *pdev) ...@@ -519,7 +519,7 @@ static int hisi_hha_pmu_probe(struct platform_device *pdev)
name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hisi_sccl%u_hha%u", name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hisi_sccl%u_hha%u",
hha_pmu->sccl_id, hha_pmu->index_id); hha_pmu->sccl_id, hha_pmu->index_id);
hisi_pmu_init(hha_pmu, name, THIS_MODULE); hisi_pmu_init(hha_pmu, THIS_MODULE);
ret = perf_pmu_register(&hha_pmu->pmu, name, -1); ret = perf_pmu_register(&hha_pmu->pmu, name, -1);
if (ret) { if (ret) {
......
...@@ -557,7 +557,7 @@ static int hisi_l3c_pmu_probe(struct platform_device *pdev) ...@@ -557,7 +557,7 @@ static int hisi_l3c_pmu_probe(struct platform_device *pdev)
*/ */
name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hisi_sccl%u_l3c%u", name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hisi_sccl%u_l3c%u",
l3c_pmu->sccl_id, l3c_pmu->ccl_id); l3c_pmu->sccl_id, l3c_pmu->ccl_id);
hisi_pmu_init(l3c_pmu, name, THIS_MODULE); hisi_pmu_init(l3c_pmu, THIS_MODULE);
ret = perf_pmu_register(&l3c_pmu->pmu, name, -1); ret = perf_pmu_register(&l3c_pmu->pmu, name, -1);
if (ret) { if (ret) {
......
...@@ -412,7 +412,7 @@ static int hisi_pa_pmu_probe(struct platform_device *pdev) ...@@ -412,7 +412,7 @@ static int hisi_pa_pmu_probe(struct platform_device *pdev)
return ret; return ret;
} }
hisi_pmu_init(pa_pmu, name, THIS_MODULE); hisi_pmu_init(pa_pmu, THIS_MODULE);
ret = perf_pmu_register(&pa_pmu->pmu, name, -1); ret = perf_pmu_register(&pa_pmu->pmu, name, -1);
if (ret) { if (ret) {
dev_err(pa_pmu->dev, "PMU register failed, ret = %d\n", ret); dev_err(pa_pmu->dev, "PMU register failed, ret = %d\n", ret);
......
...@@ -531,12 +531,10 @@ int hisi_uncore_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) ...@@ -531,12 +531,10 @@ int hisi_uncore_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node)
} }
EXPORT_SYMBOL_GPL(hisi_uncore_pmu_offline_cpu); EXPORT_SYMBOL_GPL(hisi_uncore_pmu_offline_cpu);
void hisi_pmu_init(struct hisi_pmu *hisi_pmu, const char *name, void hisi_pmu_init(struct hisi_pmu *hisi_pmu, struct module *module)
struct module *module)
{ {
struct pmu *pmu = &hisi_pmu->pmu; struct pmu *pmu = &hisi_pmu->pmu;
pmu->name = name;
pmu->module = module; pmu->module = module;
pmu->task_ctx_nr = perf_invalid_context; pmu->task_ctx_nr = perf_invalid_context;
pmu->event_init = hisi_uncore_pmu_event_init; pmu->event_init = hisi_uncore_pmu_event_init;
......
...@@ -121,6 +121,5 @@ ssize_t hisi_uncore_pmu_identifier_attr_show(struct device *dev, ...@@ -121,6 +121,5 @@ ssize_t hisi_uncore_pmu_identifier_attr_show(struct device *dev,
int hisi_uncore_pmu_init_irq(struct hisi_pmu *hisi_pmu, int hisi_uncore_pmu_init_irq(struct hisi_pmu *hisi_pmu,
struct platform_device *pdev); struct platform_device *pdev);
void hisi_pmu_init(struct hisi_pmu *hisi_pmu, const char *name, void hisi_pmu_init(struct hisi_pmu *hisi_pmu, struct module *module);
struct module *module);
#endif /* __HISI_UNCORE_PMU_H__ */ #endif /* __HISI_UNCORE_PMU_H__ */
...@@ -445,7 +445,7 @@ static int hisi_sllc_pmu_probe(struct platform_device *pdev) ...@@ -445,7 +445,7 @@ static int hisi_sllc_pmu_probe(struct platform_device *pdev)
return ret; return ret;
} }
hisi_pmu_init(sllc_pmu, name, THIS_MODULE); hisi_pmu_init(sllc_pmu, THIS_MODULE);
ret = perf_pmu_register(&sllc_pmu->pmu, name, -1); ret = perf_pmu_register(&sllc_pmu->pmu, name, -1);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment