[PATCH] arm_pmu: Drop redundant armpmu->map_event() in armpmu_event_init()

From: Anshuman Khandual
Date: Wed Nov 30 2022 - 03:35:46 EST


__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 <catalin.marinas@xxxxxxx>
Cc: Will Deacon <will@xxxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx>
---
This applies on v6.1-rc6

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

diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 6538cec1a601..4be6869005f1 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -529,10 +529,6 @@ static int armpmu_event_init(struct perf_event *event)
return -EOPNOTSUPP;
}
}
-
- if (armpmu->map_event(event) == -ENOENT)
- return -ENOENT;
-
return __hw_perf_event_init(event);
}

--
2.25.1