[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231024092954.42297-3-yangyicong@huawei.com>
Date: Tue, 24 Oct 2023 17:29:54 +0800
From: Yicong Yang <yangyicong@...wei.com>
To: <jonathan.cameron@...wei.com>, <will@...nel.org>,
<mark.rutland@....com>, <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
CC: <hejunhao3@...wei.com>, <prime.zeng@...ilicon.com>,
<yangyicong@...ilicon.com>, <linuxarm@...wei.com>
Subject: [PATCH 2/2] drivers/perf: hisi_pcie: Initialize event->cpu only on success
From: Yicong Yang <yangyicong@...ilicon.com>
Initialize the event->cpu only on success. To be more reasonable
and keep consistent with other PMUs.
Signed-off-by: Yicong Yang <yangyicong@...ilicon.com>
---
drivers/perf/hisilicon/hisi_pcie_pmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/perf/hisilicon/hisi_pcie_pmu.c b/drivers/perf/hisilicon/hisi_pcie_pmu.c
index 051efffc44c8..b90ba8aca3fa 100644
--- a/drivers/perf/hisilicon/hisi_pcie_pmu.c
+++ b/drivers/perf/hisilicon/hisi_pcie_pmu.c
@@ -357,8 +357,6 @@ static int hisi_pcie_pmu_event_init(struct perf_event *event)
if (event->attr.type != event->pmu->type)
return -ENOENT;
- event->cpu = pcie_pmu->on_cpu;
-
if (EXT_COUNTER_IS_USED(hisi_pcie_get_event(event)))
hwc->event_base = HISI_PCIE_EXT_CNT;
else
@@ -374,6 +372,8 @@ static int hisi_pcie_pmu_event_init(struct perf_event *event)
if (!hisi_pcie_pmu_validate_event_group(event))
return -EINVAL;
+ event->cpu = pcie_pmu->on_cpu;
+
return 0;
}
--
2.24.0
Powered by blists - more mailing lists