2022-12-02 02:51:43

by Anshuman Khandual

[permalink] [raw]
Subject: [PATCH V2] arm_pmu: Drop redundant armpmu->map_event() in armpmu_event_init()

__hw_perf_event_init() already calls armpmu->map_event() callback, and also
returns its error code including -ENOENT, along with a debug callout. Hence
an additional armpmu->map_event() check for -ENOENT is redundant.

Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: [email protected]
Cc: [email protected]
Acked-by: Mark Rutland <[email protected]>
Signed-off-by: Anshuman Khandual <[email protected]>
---
Changes in V2:

- Rebased on arm64 (for-next/perf)

Changes in V1:

https://lore.kernel.org/all/[email protected]/

drivers/perf/arm_pmu.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 3f07df5a7e95..ed89748b1612 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -514,9 +514,6 @@ static int armpmu_event_init(struct perf_event *event)
if (has_branch_stack(event))
return -EOPNOTSUPP;

- if (armpmu->map_event(event) == -ENOENT)
- return -ENOENT;
-
return __hw_perf_event_init(event);
}

--
2.25.1


2022-12-02 11:33:43

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH V2] arm_pmu: Drop redundant armpmu->map_event() in armpmu_event_init()

On Fri, 2 Dec 2022 07:26:11 +0530, Anshuman Khandual wrote:
> __hw_perf_event_init() already calls armpmu->map_event() callback, and also
> returns its error code including -ENOENT, along with a debug callout. Hence
> an additional armpmu->map_event() check for -ENOENT is redundant.
>
>

Applied to will (for-next/perf), thanks!

[1/1] arm_pmu: Drop redundant armpmu->map_event() in armpmu_event_init()
https://git.kernel.org/will/c/4361251cef46

Cheers,
--
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev