Commit 083c5214 authored by Mark Rutland's avatar Mark Rutland Committed by Will Deacon

drivers/perf: arm_pmu: define armpmu_init_fn

We expect an ARM PMU's init function to have a particular prototype,
which we open-code in a few places. This is less than ideal, considering
that we cast a void value to this type in one location, and a mismatch
could easily be missed.

Add a typedef so that we can ensure this is consistent.
Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Tested-by: default avatarJeremy Linton <jeremy.linton@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent a9e469d1
...@@ -989,7 +989,7 @@ int arm_pmu_device_probe(struct platform_device *pdev, ...@@ -989,7 +989,7 @@ int arm_pmu_device_probe(struct platform_device *pdev,
const struct pmu_probe_info *probe_table) const struct pmu_probe_info *probe_table)
{ {
const struct of_device_id *of_id; const struct of_device_id *of_id;
const int (*init_fn)(struct arm_pmu *); armpmu_init_fn init_fn;
struct device_node *node = pdev->dev.of_node; struct device_node *node = pdev->dev.of_node;
struct arm_pmu *pmu; struct arm_pmu *pmu;
int ret = -ENODEV; int ret = -ENODEV;
......
...@@ -132,10 +132,12 @@ int armpmu_map_event(struct perf_event *event, ...@@ -132,10 +132,12 @@ int armpmu_map_event(struct perf_event *event,
[PERF_COUNT_HW_CACHE_RESULT_MAX], [PERF_COUNT_HW_CACHE_RESULT_MAX],
u32 raw_event_mask); u32 raw_event_mask);
typedef int (*armpmu_init_fn)(struct arm_pmu *);
struct pmu_probe_info { struct pmu_probe_info {
unsigned int cpuid; unsigned int cpuid;
unsigned int mask; unsigned int mask;
int (*init)(struct arm_pmu *); armpmu_init_fn init;
}; };
#define PMU_PROBE(_cpuid, _mask, _fn) \ #define PMU_PROBE(_cpuid, _mask, _fn) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment