Skip to content

Commit 868f8a7

Browse files
Yicong Yangwilldeacon
authored andcommitted
drivers/perf: hisi_pcie: Initialize event->cpu only on success
Initialize the event->cpu only on success. To be more reasonable and keep consistent with other PMUs. Signed-off-by: Yicong Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 6d7d51e commit 868f8a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/perf/hisilicon/hisi_pcie_pmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,6 @@ static int hisi_pcie_pmu_event_init(struct perf_event *event)
357357
if (event->attr.type != event->pmu->type)
358358
return -ENOENT;
359359

360-
event->cpu = pcie_pmu->on_cpu;
361-
362360
if (EXT_COUNTER_IS_USED(hisi_pcie_get_event(event)))
363361
hwc->event_base = HISI_PCIE_EXT_CNT;
364362
else
@@ -374,6 +372,8 @@ static int hisi_pcie_pmu_event_init(struct perf_event *event)
374372
if (!hisi_pcie_pmu_validate_event_group(event))
375373
return -EINVAL;
376374

375+
event->cpu = pcie_pmu->on_cpu;
376+
377377
return 0;
378378
}
379379

0 commit comments

Comments
 (0)