projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d7d51e
)
drivers/perf: hisi_pcie: Initialize event->cpu only on success
author
Yicong Yang
<yangyicong@hisilicon.com>
Tue, 24 Oct 2023 09:29:54 +0000
(17:29 +0800)
committer
Will Deacon
<will@kernel.org>
Tue, 24 Oct 2023 11:30:45 +0000
(12:30 +0100)
Initialize the event->cpu only on success. To be more reasonable
and keep consistent with other PMUs.
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Link:
https://lore.kernel.org/r/20231024092954.42297-3-yangyicong@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/hisilicon/hisi_pcie_pmu.c
patch
|
blob
|
history
diff --git
a/drivers/perf/hisilicon/hisi_pcie_pmu.c
b/drivers/perf/hisilicon/hisi_pcie_pmu.c
index 051efffc44c82a18b445b4841406c76974afc64a..b90ba8aca3fa564b9eb4c52999b59d241e8fd429 100644
(file)
--- 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;
}